﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Harry Steinhilber commented on Is select (System.Uri) broken?</title><description>@Nick
  
Actually the second call is actually being made. You can try assigning the instance to a var and printing it out, which works.
  
  
The issue, as Jan and Alex pointed out, is the lack of a config file for the AppDomain, but it is only checked once. Specifying any config file (even a non-existent one) will get rid of the error. But as xUnit is the one setting up the AppDomain in the original example, I don't think that is very useful information.
  
  
This does seem like a bug, though, since specifying a non-existent file can make the exception go away...
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment20</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment20</guid><pubDate>Fri, 05 Mar 2010 12:48:43 GMT</pubDate></item><item><title>Tr&amp;#226;̀n Hoàng Chương commented on Is select (System.Uri) broken?</title><description>Hi,
  
  
If you blame for machine.config, you might be correct because I see that: when creating the instance of AppDomainSetup  with not empty ConfigurationFile, the console is working well.
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment19</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment19</guid><pubDate>Fri, 05 Mar 2010 08:06:03 GMT</pubDate></item><item><title>Nick berardi commented on Is select (System.Uri) broken?</title><description>My bet is second one isn't making it past the compiler since the obj is never used. Also the error says you have an Illegal char in your config. Probably the new international section that specifies how to use Unicode in the URL. Check 
&lt;idn section. 
&gt;</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment18</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment18</guid><pubDate>Thu, 04 Mar 2010 22:30:21 GMT</pubDate></item><item><title>Frank Quednau commented on Is select (System.Uri) broken?</title><description>@timoconell
  
Wow...I just debugged into the class and it is extraordinarily huge! I never thought that making a Uri is that complicated...
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment17</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment17</guid><pubDate>Thu, 04 Mar 2010 22:08:00 GMT</pubDate></item><item><title>timoconnell commented on Is select (System.Uri) broken?</title><description>oops, disassembles ;)
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment16</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment16</guid><pubDate>Thu, 04 Mar 2010 20:25:49 GMT</pubDate></item><item><title>timoconnell commented on Is select (System.Uri) broken?</title><description>@Alex Simkin
  
  
Thanks for the follow up. You answered my question. Interesting that System.Uri dissambles to over 6000 lines!
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment15</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment15</guid><pubDate>Thu, 04 Mar 2010 20:23:53 GMT</pubDate></item><item><title>Alex Simkin commented on Is select (System.Uri) broken?</title><description>Now it is easy to explain why it works for the second time.
  
  
 private static void InitializeUriConfig()
  
        { 
  
            if (!s_ConfigInitialized) { 
  
                lock(InitializeLock) {
  
                    if (!s_ConfigInitialized) { 
  
  
                        // Set this first to avoid possible recursion
  
                        // if GetConfig's callees use Uri methods.
  
                        s_ConfigInitialized = true; 
  
  
                        GetConfig(ref s_IdnScope, ref s_IriParsing); 
  
  
                    }
  
                } 
  
            }
  
        }
  
  
It only tries to parse config once.
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment14</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment14</guid><pubDate>Thu, 04 Mar 2010 20:04:31 GMT</pubDate></item><item><title>anonymous coward commented on Is select (System.Uri) broken?</title><description>i am not your helpdesk
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment13</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment13</guid><pubDate>Thu, 04 Mar 2010 20:02:05 GMT</pubDate></item><item><title>Jacob commented on Is select (System.Uri) broken?</title><description>Jan's comment sparked an interesting hunt. Could it be that you have IRI (International Resource Identifier) turned on in the machine.config? In the help file for the Uri class, it mentions that doing so prompts the Uri class to check your config for whether or not to parse using IDN (Internationalized Domain Name) rules. If it is expecting to find the config element and *isn't* that could account for finding a null during the ParseConfigFile call reference by Jan.
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment12</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment12</guid><pubDate>Thu, 04 Mar 2010 19:55:08 GMT</pubDate></item><item><title>benek commented on Is select (System.Uri) broken?</title><description>I got only this error:
  
+		$exception	{"Invalid URI: The Authority/Host could not be parsed."}	System.Exception {System.UriFormatException}
  
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment11</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment11</guid><pubDate>Thu, 04 Mar 2010 19:44:16 GMT</pubDate></item><item><title>Jan Willem B commented on Is select (System.Uri) broken?</title><description>It has nothing to do with the Uri itself. With reflector you can see it tries to parse the app config file: 
  
   ParseConfigFile(Path.Combine(Path.Combine(runtimeDirectory, "Config"), "machine.config"), out config, out config3);
  
    ParseConfigFile(appConfigFile, out config2, out config4);
  
  
So there seems to be an error in the config file, or in the path to the config file?
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment10</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment10</guid><pubDate>Thu, 04 Mar 2010 19:32:50 GMT</pubDate></item><item><title>Alex Simkin commented on Is select (System.Uri) broken?</title><description>Yep. Works for me too. So, what's the exception?
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment9</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment9</guid><pubDate>Thu, 04 Mar 2010 19:25:55 GMT</pubDate></item><item><title>Diego Mijelshon commented on Is select (System.Uri) broken?</title><description>Works here... but what's the exception?
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment8</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment8</guid><pubDate>Thu, 04 Mar 2010 19:16:23 GMT</pubDate></item><item><title>Ayende Rahien commented on Is select (System.Uri) broken?</title><description>timoconnell ,
  
Then why would it work the second time around?
  
And this is a console app
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment7</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment7</guid><pubDate>Thu, 04 Mar 2010 19:16:00 GMT</pubDate></item><item><title>Ayende Rahien commented on Is select (System.Uri) broken?</title><description>Matthijs, 
  
Nope.
  
And even if there was, why wouldn't it work on the second time around?
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment6</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment6</guid><pubDate>Thu, 04 Mar 2010 19:15:26 GMT</pubDate></item><item><title>Albert Weinert commented on Is select (System.Uri) broken?</title><description>A   :   (%3A) is forbidden in an URI in ASP.NET up to  3.5.
  
  
In ASP.NET 4.0 you can allow it with some settings in web.config (forgot the name).
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment5</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment5</guid><pubDate>Thu, 04 Mar 2010 19:14:56 GMT</pubDate></item><item><title>Michael Stum commented on Is select (System.Uri) broken?</title><description>* Is this really System.Uri, or possibly another class Uri in another namespace?
  
* check the bytes of the uristring , is there maybe something that LOOKS like a :, /, &amp; or = but really is some weird Unicode character?
  
* What is the Exception?
  
* Maybe use Reflector Pro, set a breakpoint on System.Uri.InitializeUri and check what exactly this does to your Uri?
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment4</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment4</guid><pubDate>Thu, 04 Mar 2010 19:13:51 GMT</pubDate></item><item><title>Jan Willem B commented on Is select (System.Uri) broken?</title><description>only thing I can think of is a race condition where uriString changes after the exception was already thrown. 
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment3</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment3</guid><pubDate>Thu, 04 Mar 2010 19:13:28 GMT</pubDate></item><item><title>timoconnell commented on Is select (System.Uri) broken?</title><description>Maybe,
  
  
NET or IIS doesn't allow colons in urls
  
  
[stackoverflow.com/.../using-a-colon-in-a-url-wi...](http://stackoverflow.com/questions/667429/using-a-colon-in-a-url-with-asp-net-iis)</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment2</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment2</guid><pubDate>Thu, 04 Mar 2010 19:12:55 GMT</pubDate></item><item><title>Matthijs ter Woord commented on Is select (System.Uri) broken?</title><description>Hi,
  
  
Any app.config settings involving system.net ?
  
  
Regards,
  
Matthijs ter Woord
</description><link>http://ayende.com/4422/is-select-system-uri-broken#comment1</link><guid>http://ayende.com/4422/is-select-system-uri-broken#comment1</guid><pubDate>Thu, 04 Mar 2010 19:11:23 GMT</pubDate></item></channel></rss>