After installing VS2012 Premium on a dev machine a unit test failed, so the developer fixed the issue. When the changes were pushed to TeamCity the unit test failed. The pro
There are some changes introduced in .NET Framework 4.5, which is installed along with VS2012, and which is also (to the best of my knowledge) a so called "in place upgrade". This means that it actually upgrades .NET Framework 4.
Furthermore, there are breaking changes documented in System.Uri. One of them says Unicode normalization form C (NFC) will no longer be performed on non-host portions of URIs. I am not sure whether this is applicable to your case, but it could serve as a good starting point in your investigation of the error.
In that situation you can't do like that. The main issue is the character "¶".
In .Net we got a problem on character ¶. You can make a research on that.
Take the uri' parameters one by one. Add them by one by and compare them. May be you can use a method for "¶" character to create it or replace it.
For example;
Dim uri = New Uri("http://www.example.org/test?helloworld=foo%B6bar")
Assert.AreEqual("http://www.example.org/test?helloworld=foo¶bar", uri.Host+uri.AbsolutePath+"?"+uri.Query)
that'll work
uri.AbsolutePath: /test
url.Host: http://www.example.org
uri.Query: helloworld=foo¶bar
The change is related to problems with earlier .NET versions, which have now changed to become more compliant to the standards. %B6
is UTF-16, but according to the standards UTF-8 should be used in the Uri, meaning that it should be %C2%B6
. So as %B6
is not UTF-8 it is now correctly ignored and not decoded.
More details from the connect report quoted in verbatim below.
.NET 4.5 has enhanced and more compatible application of RFC 3987 which supports IRI parsing rules for URI's. IRIs are International Resource Identifiers. This allows for non-ASCII characters to be in a URI/IRI string to be parsed.
Prior to .NET 4.5, we had some inconsistent handling of IRIs. We had an app.config entry with a default of false that you could turn on:
which did some IRI handling/parsing. However, it had some problems. In particular it allowed for incorrect percent encoding handling. Percent-encoded items in a URI/IRI string are supposed to be percent-encoded UTF-8 octets according to RFC 3987. They are not interpreted as percent-encoded UTF-16. So, handling “%B6” is incorrect according to UTF-8 and no decoding will occur. The correct UTF-8 encoding for ¶ is actually “%C2%B6”.
If your string was this instead:
string strUri = @"http://www.example.com/test?helloworld=foo%C2%B6bar";
Then it will get normalized in the ToString() method and the percent-encoding decoded and removed.
Can you provide more information about your application needs and the use of ToString() method? Usually, we recommend the AbsoluteUri property of the Uri object for most normalization needs.
If this issue is blocking your application development and business needs then please let us know via the "netfx45compat at Microsoft dot com" email address.
Thx,
Networking Team