COMMENTS
Isn't the Replace for the file:// required for both case? E.g. UriBuilder("\\foo\bar").ToString() and UrilBuilder("c:\foo\bar").ToString() seem to return "file://foo/bar" and "file://C:/foo/bar" in PowerShell.
That's what I thought too. Apparently, UNC paths and drive paths get treated differently by UriBuilder. I noticed this after I got done testing UNC paths and went back to drive paths for testing.
I want to look at UriBuilder with Reflector when I have time.
Your first example, UriBuilder("\\foo\bar"), would throw an exception, unless "foo" is a host name accessible in your LAN.
Well, this is the PowerShell command line I used:
$(New-Object System.UriBuilder("\\foo\bar")).ToString()
And there's no accessible foo hostname on my lan. Maybe this is some PowerShell thing...
Interesting! That blows up in Visual Studio.