Hi list,
I am parsing a URL to connect to a WCF service. Try this:
new Uri("net.tcp://guest:guest@myserver:12345");
I get a UriFormatException that complains about an invalid port
number. Uri.TryCreate is no better.
It works if I remove the userinfo (credentials). It also works if I
don't use a scheme with a dot in it. I need both, however.
As far as I can tell, this *is* a valid URI according to RFC 2396 and
RFC 3986. It works in Mono. It works in other languages. I think
.NET's URI parser is busted (Framework 4.5).
Thomas Koster
p.s. Technically, the URI "userinfo" is a part of the URI "authority"
[1][2], but the System.Uri.Authority property does not include
userinfo. It seems the designer of the System.Uri class did not read
the RFCs carefully enough, either.
[1] RFC 2396, 3.2. "Authority Component"
[2] RFC 3986, 3.2. "Authority"