<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Design Guideline Update: Uri vs. string</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx</link><description>ChrisAn blogged about this a few weeks ago and I am happy to announce that Krzysztof Cwalina has a guideline ready for you to comment on! System.URI Usage Use System.Uri to represent URI/URL data. This applies to parameter types, property types, and return</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Design Guideline Update: Uri vs. string</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#58033</link><pubDate>Tue, 13 Jan 2004 00:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:58033</guid><dc:creator>Andy</dc:creator><description>Any chance the &amp;quot;excellent&amp;quot; doc can be put somewhere public?</description></item><item><title>re: Design Guideline Update: Uri vs. string</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#58045</link><pubDate>Tue, 13 Jan 2004 01:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:58045</guid><dc:creator>Brad Abrans</dc:creator><description>Sorry about the bad whitepaper link... I am working on getting it posted outside the farm now..</description></item><item><title>re: Design Guideline Update: Uri vs. string</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#59504</link><pubDate>Fri, 16 Jan 2004 21:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:59504</guid><dc:creator>Ken Brubaker</dc:creator><description>Can you make a more generic rule for when to use composite types and simple types. This rule could apply for System.Guid and string for example.</description></item><item><title>New and Notable 35</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#59910</link><pubDate>Sun, 18 Jan 2004 19:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:59910</guid><dc:creator>Sam Gentile's Blog</dc:creator><description /></item><item><title>re: Design Guideline Update: Uri vs. string</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#60301</link><pubDate>Mon, 19 Jan 2004 20:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:60301</guid><dc:creator>Peter</dc:creator><description>I'm not so happy with the uri class because:&lt;br&gt;&lt;br&gt;I’ve noticed some strange behaviors with the uri class,&lt;br&gt;First the constructor has strange behavior (first code snippet)&lt;br&gt;Second the EQUALS method and the ==/!= operators behave differently ?&lt;br&gt;&lt;br&gt;&lt;br&gt;string partialUrl=&amp;quot;../../Styles/Common/Styles.css&amp;quot;;&lt;br&gt;string anotherUrl=&amp;quot;../Styles/Common/Styles.css&amp;quot;;&lt;br&gt;Uri remoteUri = new Uri(&amp;quot;&lt;a target="_new" href="http://pdemeyer01/nbbcms/test.html&amp;quot;"&gt;http://pdemeyer01/nbbcms/test.html&amp;quot;&lt;/a&gt;);&lt;br&gt;Uri anUri = new Uri(remoteUri,partialUrl);&lt;br&gt;Console.WriteLine(anUri.AbsoluteUri); //prints &lt;a target="_new" href="http://pdemeyer01/../Styles/Common/Styles.css"&gt;http://pdemeyer01/../Styles/Common/Styles.css&lt;/a&gt; INCORRECT&lt;br&gt;anUri = new Uri(remoteUri,anotherUrl );&lt;br&gt;Console.WriteLine(anUri.AbsoluteUri); //prints &lt;a target="_new" href="http://pdemeyer01/Styles/Common/Styles.css"&gt;http://pdemeyer01/Styles/Common/Styles.css&lt;/a&gt; CORRECT&lt;br&gt;&lt;br&gt;&lt;br&gt;Queue aQueue = new Queue();&lt;br&gt;Uri NL =new Uri(&amp;quot;&lt;a target="_new" href="http://localhost/NBBCMS/WebForm1.aspx?Language=NL&amp;quot;"&gt;http://localhost/NBBCMS/WebForm1.aspx?Language=NL&amp;quot;&lt;/a&gt;);&lt;br&gt;Uri UK=new Uri(&amp;quot;&lt;a target="_new" href="http://localhost/NBBCMS/WebForm1.aspx?Language=UK&amp;quot;"&gt;http://localhost/NBBCMS/WebForm1.aspx?Language=UK&amp;quot;&lt;/a&gt;);&lt;br&gt; &lt;br&gt;aQueue.Enqueue(NL);&lt;br&gt;if (!aQueue.Contains(UK))&lt;br&gt;	Console.WriteLine(&amp;quot;UK Not in the queue&amp;quot;);&lt;br&gt;else                                      &lt;br&gt;     Console.WriteLine(&amp;quot;UK Already in Queue&amp;quot;); //prints UK Already in Queue INCORRECT &lt;br&gt;if (UK.Equals(NL))&lt;br&gt;	Console.WriteLine(&amp;quot;UK Equals NL&amp;quot;); //prints UK Equals NL INCORRECT&lt;br&gt;if (UK!=NL)&lt;br&gt;		Console.WriteLine(&amp;quot;UK != NL&amp;quot;); //prints UK != NL CORRECT&lt;br&gt;</description></item><item><title>re: Design Guideline Update: Uri vs. string</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#60469</link><pubDate>Tue, 20 Jan 2004 04:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:60469</guid><dc:creator>Brad Abrams</dc:creator><description>From the dev team: You will be glad to know that we have fixed this in the current builds... &lt;br&gt;&lt;br&gt;Now it prints:&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="&lt;a target="_new" href="http://pdemeyer01/Styles/Common/Styles.css"&gt;http://pdemeyer01/Styles/Common/Styles.css&lt;/a&gt;"&gt;&lt;a target="_new" href="http://pdemeyer01/Styles/Common/Styles.css"&gt;http://pdemeyer01/Styles/Common/Styles.css&lt;/a&gt;&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="&lt;a target="_new" href="http://pdemeyer01/Styles/Common/Styles.css"&gt;http://pdemeyer01/Styles/Common/Styles.css&lt;/a&gt;"&gt;&lt;a target="_new" href="http://pdemeyer01/Styles/Common/Styles.css"&gt;http://pdemeyer01/Styles/Common/Styles.css&lt;/a&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;UK Not in the queue&lt;br&gt;&lt;br&gt;UK != NL&lt;br&gt;&lt;br&gt;Note Uri.Equals() will still ignore userinfo and fragment parts.&lt;br&gt;&lt;br&gt;For now this is to maintain compatibility with v1.0 when a uri is used to resolve a resource (not to identify it)&lt;br&gt;&lt;br&gt;Ignoring a query part was just a plain bug.&lt;br&gt;</description></item><item><title>Microsoft Design Guidelines</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#82100</link><pubDate>Mon, 01 Mar 2004 20:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:82100</guid><dc:creator>James Geurts' Blog</dc:creator><description /></item><item><title>re: Design Guideline Update: Uri vs. string</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#133206</link><pubDate>Mon, 17 May 2004 14:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:133206</guid><dc:creator>Doug McClean</dc:creator><description>This is off topic, but does anyone have any idea why System.Uri inherits System.MarshalByRefObject? Seems like a very odd choice for such an obviously serializable type, that is marked as serializable, and that appears to be immutable (doesn't have any set accessors or methods that seem like they should have side effects). Can anyone weigh in on this? Under what circumstances would a serializable type be marshaled by reference, anyway?</description></item><item><title>System.Uri and MarshalByRefObject</title><link>http://blogs.msdn.com/brada/archive/2004/01/12/58031.aspx#199287</link><pubDate>Wed, 28 Jul 2004 06:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:199287</guid><dc:creator>Brad Abrams </dc:creator><description /></item></channel></rss>