问题
In a .NET 4 console application, and a Silverlight 4 application, the following returns false
:
Uri.IsWellFormedUriString("/test", UriKind.Absolute)
but the same call in a Windows Phone app (7.0 or 7.1 using SDK 7.1 Beta 2 published 6/29/11) returns true
.
Can anyone else confirm this? Is this a bug in WP7?
Update
I reported this as a bug on Microsoft Connect and received an update today that it has been closed as "Wont' Fix". This doesn't matter to me but I thought I would add this update just as an FYI.
回答1:
After the documentation its a bug:
A Boolean value that is true if the string was well-formed in accordance with RFC 3986; else false.
And the RFC 3986 says:
absolute-URI = scheme ":" hier-part [ "?" query ]
So better submit this bug on Microsoft Connect under VS referencing the Tooling Version for phone development tools.
来源:https://stackoverflow.com/questions/6977325/bug-in-wp-7-implementation-of-uri-iswellformeduristring