<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.johannesh.dk/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0IBSHcyfCp7ImA9WxBQE0w.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357</id><updated>2010-01-12T17:59:19.994+01:00</updated><title>Johannes Hansen's Blog</title><subtitle type="html">CleverCode &amp;lt;= GoodCode</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.johannesh.dk/" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.johannesh.dk/JohannesHansensBlog" /><feedburner:info uri="johanneshansensblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>55.23281</geo:lat><geo:long>11.764909</geo:long><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by/2.0/" /><entry gd:etag="W/&quot;CEMHQ385fyp7ImA9WxRWGE4.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-6066999257556653226</id><published>2008-11-04T22:00:00.001+01:00</published><updated>2008-11-04T22:00:32.127+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-04T22:00:32.127+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="NonNullable" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Spec#" /><category scheme="http://www.blogger.com/atom/ns#" term="DbC" /><category scheme="http://www.blogger.com/atom/ns#" term="VS2010" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="NonNull" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming by Contract" /><category scheme="http://www.blogger.com/atom/ns#" term="Design by Contract" /><title>Microsoft Code Contracts project site</title><content type="html">&lt;p&gt;If you are interested in learning more about the coming Design by Contract stuff in .NET 4.0 here is the link for the &lt;a target="_blank" href="http://research.microsoft.com/contracts/"&gt;Microsoft Code Contracts&lt;/a&gt; project site. At the site you can download a MSI containing the documentation as well as a research implementation of the code contracts and some of the VS integration for VS2008. However, it’s under the research license so you won’t be able to use it in a production environment.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-6066999257556653226?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Pd6NbQKwx03tkPz5PqFzFd4Eh1A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pd6NbQKwx03tkPz5PqFzFd4Eh1A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Pd6NbQKwx03tkPz5PqFzFd4Eh1A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pd6NbQKwx03tkPz5PqFzFd4Eh1A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=Wl7QAZkp"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=mZOabmOy"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=mZOabmOy" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=JRAem1rb"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=JRAem1rb" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/3SiHvK2UUDU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/6066999257556653226/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/11/microsoft-code-contracts-project-site.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/6066999257556653226?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/6066999257556653226?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/3SiHvK2UUDU/microsoft-code-contracts-project-site.html" title="Microsoft Code Contracts project site" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/11/microsoft-code-contracts-project-site.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEASX47eCp7ImA9WxRWFkQ.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-4593088150892225175</id><published>2008-11-02T19:08:00.002+01:00</published><updated>2008-11-03T07:44:08.000+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-03T07:44:08.000+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Nullable" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="NonNull" /><category scheme="http://www.blogger.com/atom/ns#" term="NonNullable" /><category scheme="http://www.blogger.com/atom/ns#" term="Spec#" /><category scheme="http://www.blogger.com/atom/ns#" term="Null" /><category scheme="http://www.blogger.com/atom/ns#" term="DbC" /><category scheme="http://www.blogger.com/atom/ns#" term="VS2010" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming by Contract" /><category scheme="http://www.blogger.com/atom/ns#" term="Design by Contract" /><title>Programming by contract features coming in .NET 4.0!!!</title><content type="html">&lt;div style="margin: 1em; display: block; float: right" class="zemanta-img"&gt;&lt;a href="http://www.daylife.com/image/0bwFe6L2GJc9S"&gt;&lt;img style="border-bottom-style: none; border-right-style: none; display: block; border-top-style: none; border-left-style: none" alt="LOS ANGELES - OCTOBER 27:  In this photograph ..." src="http://cache.daylife.com/imageserve/0bwFe6L2GJc9S/150x98.jpg" /&gt;&lt;/a&gt;     &lt;p style="font-size: 0.8em" class="zemanta-img-attribution"&gt;Image by &lt;a href="http://www.daylife.com/source/Getty_Images"&gt;Getty Images&lt;/a&gt; via &lt;a href="http://www.daylife.com/"&gt;Daylife&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;It happened! The BCL team proved me wrong (see my two previous posts), and I’m very happy that they did!&lt;/p&gt;&lt;p&gt;So, I’ve been sitting for the last couple of hours watching some of the many interesting PDC2008 sessions online. In particular the day 4 sessions “TL51 Research: Contract Checking and Automated Test Generation with Pex” and “PC49 Microsoft .NET Framework: CLR Futures” were extremely interesting from my perspective. In fact, I’m so excited to write this that I’m almost shaking!&lt;/p&gt;&lt;p&gt;What has gotten me so excited was the announcement that we will finally be able to do &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Design_by_contract"&gt;programming by contract&lt;/a&gt; with the next version of the .NET framework. And it will be integrated into VS2010 so we will see contract violations when compiling. Awesome! For those of you who know about the Spec# project, these new PbC features are the evolution of Spec# into something usable, not just by C# but by all .NET languages.&lt;/p&gt;&lt;p&gt;The &lt;a target="_blank" href="http://channel9.msdn.com/pdc2008/TL51/"&gt;TL51 session&lt;/a&gt; also talked about another extemely cool project called &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/devlabs/cc950525.aspx"&gt;Pex&lt;/a&gt; which is now a Microsoft DevLabs project. The Pex project and the programming by contract features makes up a nice bug killing combo. So if you like bug-free code, like I do, you should pay very close attention to these projects in the future.&lt;/p&gt;&lt;p&gt;Finally I’d like to recommend that you go check out the &lt;a target="_blank" href="https://sessions.microsoftpdc.com/public/timeline.aspx"&gt;PDC2008 session list&lt;/a&gt;. I’m sure you will find at least 1 or 2&amp;#160; interesting talks in there, though I suspect you will find many more. ;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-4593088150892225175?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fJdVQmDbchlngu6XphY8UZ24VvA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fJdVQmDbchlngu6XphY8UZ24VvA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fJdVQmDbchlngu6XphY8UZ24VvA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fJdVQmDbchlngu6XphY8UZ24VvA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=tvw5Bfi6"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=szOWbApF"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=szOWbApF" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=3C9mnkMu"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=3C9mnkMu" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/1z2f4RuolWc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/4593088150892225175/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/11/programming-by-contract-features-coming.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/4593088150892225175?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/4593088150892225175?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/1z2f4RuolWc/programming-by-contract-features-coming.html" title="Programming by contract features coming in .NET 4.0!!!" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/11/programming-by-contract-features-coming.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkAGSXs4eip7ImA9WxRWFkQ.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-668444251133231488</id><published>2008-10-29T05:31:00.002+01:00</published><updated>2008-11-03T07:45:28.532+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-03T07:45:28.532+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Spec#" /><category scheme="http://www.blogger.com/atom/ns#" term="DbC" /><category scheme="http://www.blogger.com/atom/ns#" term="VS2010" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming by Contract" /><category scheme="http://www.blogger.com/atom/ns#" term="Design by Contract" /><title>Extensibility in VS2010, possible opening for Spec# features?</title><content type="html">&lt;div style="margin: 1em; display: block; float: right" class="zemanta-img"&gt;&lt;a href="http://en.wikipedia.org/wiki/Image:MSVisual_Studio.png"&gt;&lt;img style="border-bottom-style: none; border-right-style: none; display: block; border-top-style: none; border-left-style: none" alt="The Microsoft Visual Studio .NET logo." src="http://upload.wikimedia.org/wikipedia/en/thumb/6/60/MSVisual_Studio.png/202px-MSVisual_Studio.png" /&gt;&lt;/a&gt;     &lt;p style="font-size: 0.8em" class="zemanta-img-attribution"&gt;Image via &lt;a href="http://en.wikipedia.org/wiki/Image:MSVisual_Studio.png"&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;So, I’ve been watching the PDC2008 keynote and my heart jumped a bit at 1:32:52 in the keynote, which was Scott Guthries part. He was talking about extensibility in VS2010 and here’s a transcription of what he says in the video.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“Going forward you’re going to see, in VS2010, that we’re gonna be opening up the extensibility all over the place. In particular within the IDE itself as well as within the text editor.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;With the next release we’re gonna go a step further, and we will also open up the language services and the compiler infrastructure as well. It’s gonna really, we think, enable some really great code capabilities.&lt;/strong&gt;”&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;You could interpret the second part of the quote in many ways but it just might be a small opening for making Spec#-like features work without having to make an intrusive change of the entire C# language. Of course this is mere speculation and I havn’t been able to find any further information on these language services and compiler infrastructure extensibility points so time will tell what it really meant. But for now I’ll take it and hold on to it as a bit of hope that we will someday see Spec# fetaures in our day-to-day projects.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-668444251133231488?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/F3zFaNiENlc7iqcr9QMZOyEgFrM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/F3zFaNiENlc7iqcr9QMZOyEgFrM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/F3zFaNiENlc7iqcr9QMZOyEgFrM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/F3zFaNiENlc7iqcr9QMZOyEgFrM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=GYewyh0Z"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=AR4bzRLB"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=AR4bzRLB" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=PZlGqsnM"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=PZlGqsnM" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/ridCt1HGS0Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/668444251133231488/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/10/extensibility-in-vs2010-possible.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/668444251133231488?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/668444251133231488?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/ridCt1HGS0Y/extensibility-in-vs2010-possible.html" title="Extensibility in VS2010, possible opening for Spec# features?" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/10/extensibility-in-vs2010-possible.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkAAQnc8eyp7ImA9WxRWFkQ.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-1331962338249909089</id><published>2008-10-24T00:53:00.004+02:00</published><updated>2008-11-03T07:45:43.973+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-03T07:45:43.973+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Nullable" /><category scheme="http://www.blogger.com/atom/ns#" term="NonNullable" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Spec#" /><category scheme="http://www.blogger.com/atom/ns#" term="Null" /><category scheme="http://www.blogger.com/atom/ns#" term="DbC" /><category scheme="http://www.blogger.com/atom/ns#" term="Generics" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="NonNull" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming by Contract" /><category scheme="http://www.blogger.com/atom/ns#" term="Design by Contract" /><title>How to make a non-nullable type wrapper in C#, today…</title><content type="html">&lt;div class="zemanta-img" style="display: block; float: right; margin: 1em;"&gt;&lt;a href="http://www.flickr.com/photos/66606673@N00/205542600"&gt;&lt;img alt="The Story of Nothing, in Arizona" src="http://farm1.static.flickr.com/93/205542600_ac440c043f_m.jpg" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; display: block;" /&gt;&lt;/a&gt;    &lt;br /&gt;
&lt;div class="zemanta-img-attribution" style="font-size: 0.8em;"&gt;Image by &lt;a href="http://www.flickr.com/photos/66606673@N00/205542600"&gt;cobalt123&lt;/a&gt; via Flickr&lt;/div&gt;&lt;/div&gt;&lt;p&gt;I was reading up on the development on Spec# and at the same time trying to figure out if we would start to see Spec# features in C#, anytime soon… Unfortunately, I don’t think we will find any Spec# features in C# 4.0, but I hope the team will prove me wrong.&lt;/p&gt;&lt;p&gt;If you haven’t looked at Spec# yet I strongly encourage you to take a look at it. The short story is that it is a research project which focuses on adding contract oriented constructs to the C# language. You can read more about it at the &lt;a href="http://research.microsoft.com/SpecSharp/" target="_blank"&gt;Spec# homepage&lt;/a&gt; or watch the &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Contract-Oriented-Programming-and-Spec/" target="_blank"&gt;Spec# introduction video on Channel9&lt;/a&gt; which shows off some of the very cool features contract oriented programming brings to the table.&lt;/p&gt;&lt;p&gt;One of the features of Spec# is non-nullable types which is a type wrapper for reference types, sort of like the Nullable&amp;lt;T&amp;gt; type we got in C# 2.0 for value types, but with opposite meaning. In Spec# non-null types can be written as “object!”.&lt;/p&gt;&lt;p&gt;When a type is wrapped with the non-nullable type it can never be set to null. I hope you are now starting to think; “Cool, that would be a nice feature to have in C#”… If you are not, let me explain why you should.&lt;/p&gt;&lt;p&gt;Imagine a world where you could avoid writing code like this:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; DoStuff(&lt;span style="color: blue;"&gt;object&lt;/span&gt; input)
{
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (input == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"input"&lt;/span&gt;);

&amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;// Method implementation...&lt;/span&gt;
}&lt;/pre&gt;&lt;p&gt;Instead you could let the language and the compiler do the null checks for you. If you are a developer by profession, think back on all the applications you’ve made and think of all the null-checking code you’ve written that you could’ve avoided if you had the non-null type feature. Or better yet, think of all the null-checks you &lt;em&gt;forgot&lt;/em&gt; to write and you then later discovered when a tester or customer reported an error that turned out to be a null reference exception. Ahh yes, those were the days, right?&lt;p/&gt;&lt;p&gt;Now, since we don’t expect Spec# features in C# anytime soon is there any way we might be able to implement this functionality with what we have? How would we go about writing a non-null type in C#? Well, a good place to start is to fire up reflector and look at how the Nullable&amp;lt;T&amp;gt; type is implemented. After doing that and looking at &lt;a href="http://msmvps.com/blogs/jon_skeet/archive/2008/10/06/non-nullable-reference-types.aspx" target="_blank"&gt;Jon Skeet’s proposal&lt;/a&gt;, I came up with the following slightly modified code:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;struct&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: blue;"&gt;class&lt;/span&gt;
{
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; T _value;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; T Value { &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _value; } }

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; NonNull(T instance)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (instance == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"instance"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;"The \"instance\" parameter must not be null."&lt;/span&gt;);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_value = instance;
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; GetHashCode()
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; _value.GetHashCode();
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; Equals(&lt;span style="color: blue;"&gt;object&lt;/span&gt; obj)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; _value.Equals(obj);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; &lt;span style="color: blue;"&gt;operator&lt;/span&gt; ==(&lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; valueA, &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; valueB)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; valueA._value == valueB._value;
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; &lt;span style="color: blue;"&gt;operator&lt;/span&gt; !=(&lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; valueA, &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; valueB)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; valueA._value != valueB._value;
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;implicit&lt;/span&gt; &lt;span style="color: blue;"&gt;operator&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt;(T value)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt;(value);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;explicit&lt;/span&gt; &lt;span style="color: blue;"&gt;operator&lt;/span&gt; T(&lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; value)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; value._value;
&amp;nbsp;&amp;nbsp;}
}&lt;/pre&gt;&lt;p&gt;But as Jon points out in his excellent blog post that would cause a &lt;em&gt;big&lt;/em&gt; problem, since a struct always adds a default parameter-less constructor (that you can’t directly customize) it would be possible to instantiate a NonNull variable with the empty constructor, and thus let the non-null type contain a null value which it clearly shouldn’t. Jon solved this problem by putting a null check in the getter of the “Value” property but this would still hide a potential null reference error till pretty late in a runtime flow. The good news is I found a different solution.&lt;/p&gt;&lt;p&gt;After doing some research I found out that MSIL doesn’t require a default empty constructor to be empty. I then simply compiled a version of the code that had an extra constructor with a dummy parameter and then deleted the parameter from the compiled assembly using the awesome &lt;a href="http://reflexil.sourceforge.net/" target="_blank"&gt;Reflexil&lt;/a&gt; plug-in for reflector. And presto, one nice little generic NonNull type wrapper was born. The final code used for this type was:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;struct&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: blue;"&gt;class&lt;/span&gt;
{
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; T _value;
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; T Value { &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _value; } }

&amp;nbsp;&amp;nbsp;[&lt;span style="color: #2b91af;"&gt;Obsolete&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"The default parameterless constructor has been disabled please use NonNull&amp;lt;T&amp;gt;(T instance) constructor instead."&lt;/span&gt;, &lt;span style="color: blue;"&gt;true&lt;/span&gt;)]
&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; NonNull(&lt;span style="color: blue;"&gt;object&lt;/span&gt; dummy)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;NotSupportedException&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"The default parameterless constructor has been disabled please use NonNull&amp;lt;T&amp;gt;(T instance) constructor instead."&lt;/span&gt;);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; NonNull(T instance)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (instance == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"instance"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;"The \"instance\" parameter must not be null."&lt;/span&gt;);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_value = instance;
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; GetHashCode()
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; _value.GetHashCode();
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; Equals(&lt;span style="color: blue;"&gt;object&lt;/span&gt; obj)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; _value.Equals(obj);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; &lt;span style="color: blue;"&gt;operator&lt;/span&gt; ==(&lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; valueA, &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; valueB)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; valueA._value == valueB._value;
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; &lt;span style="color: blue;"&gt;operator&lt;/span&gt; !=(&lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; valueA, &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; valueB)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; valueA._value != valueB._value;
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;implicit&lt;/span&gt; &lt;span style="color: blue;"&gt;operator&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt;(T value)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt;(value);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;explicit&lt;/span&gt; &lt;span style="color: blue;"&gt;operator&lt;/span&gt; T(&lt;span style="color: #2b91af;"&gt;NonNull&lt;/span&gt;&amp;lt;T&amp;gt; value)
&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; value._value;
&amp;nbsp;&amp;nbsp;}
}&lt;/pre&gt;&lt;p&gt;As you can see I opted to mark the default constructor as obsolete because that gives a nice little compile-time error if it’s used. I’m also throwing a NotSupportedException from the constructor if it happens to be executed by reflection. I realize that this class isn’t as user-friendly as you would like it to be, but for now it’s probably the closest we’ll get without help from the C# language team.&lt;/p&gt;&lt;p&gt;If you would like to try it out you can get a precompiled NonNull type &lt;a href="http://cid-f61a12f6f7c6dd75.skydrive.live.com/self.aspx/Public/NonNull.zip" target="_blank"&gt;here&lt;/a&gt;. Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-1331962338249909089?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iIsoMul1zGSh4j97NSZZQDVRHFo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iIsoMul1zGSh4j97NSZZQDVRHFo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iIsoMul1zGSh4j97NSZZQDVRHFo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iIsoMul1zGSh4j97NSZZQDVRHFo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=UIwdx02g"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=2WEtnCxM"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=2WEtnCxM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=5cygxuMP"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=5cygxuMP" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/24b0pXZeB60" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/1331962338249909089/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/10/how-to-make-non-nullable-type-wrapper.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/1331962338249909089?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/1331962338249909089?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/24b0pXZeB60/how-to-make-non-nullable-type-wrapper.html" title="How to make a non-nullable type wrapper in C#, today…" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/10/how-to-make-non-nullable-type-wrapper.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUFRHgycCp7ImA9WxdaF0Q.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-2007294977726220559</id><published>2008-08-27T01:36:00.005+02:00</published><updated>2008-08-27T02:50:15.698+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-27T02:50:15.698+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="C5" /><category scheme="http://www.blogger.com/atom/ns#" term="Patterns and Practices" /><title>Extension Types for easier (and strongly typed) Attribute checks</title><content type="html">&lt;div ?="?" class="zemanta-img" style="display: block; float: right; margin: 1em;"&gt;&lt;/div&gt;I just saw a &lt;a href="http://elegantcode.com/2008/07/30/marker-interfaces-and-c-attributes/" target="_blank"&gt;blog post&lt;/a&gt; from Alex Mueller about &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Marker_interface_pattern" rel="wikipedia" title="Marker interface pattern"&gt;marker interfaces&lt;/a&gt; and C# attributes and which way you should be using them.&lt;br /&gt;
&lt;br /&gt;
I, for one, believe that attributes are far the best way to mark a class instead of using an empty marker interface. Why? Well, there are several good reasons to use attributes over interfaces, especially when it comes to inheritance. That aside, attributes are also a lot more flexible than interfaces.&lt;br /&gt;
&lt;br /&gt;
So why don’t people use attributes more often? The most common complaint is that interfaces are easier to use and check for in code (I.e. interfaces requires less code). But I think this is mainly because people don’t know where to look for help in the framework. So I’ve devised 30 extension methods that will make your work with attributes a little bit easier and strongly typed.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;AttributeExtensions
&lt;/span&gt;{
&lt;span style="color: green;"&gt;  // Attribute.IsDefined shortcuts
&lt;/span&gt;  &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element.GetType(), &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element.GetType(), &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Assembly&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Assembly&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MemberInfo&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MemberInfo&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Module&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Module&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ParameterInfo&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)); }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; HasAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ParameterInfo&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.IsDefined(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit); }

&lt;span style="color: green;"&gt;  // Attribute.GetCustomAttribute shotcuts
&lt;/span&gt;  &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element.GetType(), &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element.GetType(), &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Assembly&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Assembly&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MemberInfo&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MemberInfo&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Module&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Module&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ParameterInfo&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T GetAttribute&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ParameterInfo&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttribute(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T; }

&lt;span style="color: green;"&gt;  // Attribute.GetCustomAttributes shortcuts
&lt;/span&gt;  &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element.GetType(), &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element.GetType(), &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Assembly&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Assembly&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MemberInfo&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MemberInfo&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Module&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Module&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ParameterInfo&lt;/span&gt; element) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T)) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
&lt;span style="color: blue;"&gt;  public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; T[] GetAttributes&amp;lt;T&amp;gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ParameterInfo&lt;/span&gt; element, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; inherit) &lt;span style="color: blue;"&gt;where&lt;/span&gt; T : &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;
    { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Attribute&lt;/span&gt;.GetCustomAttributes(element, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(T), inherit) &lt;span style="color: blue;"&gt;as&lt;/span&gt; T[]; }
}&lt;/pre&gt;&lt;br /&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;span style="color: blue; font-family: Courier New;"&gt;&lt;/span&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;
Now you can check for the existence of an attribute like this:&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; instance = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SomeClass&lt;/span&gt;();

&lt;span style="color: green;"&gt;// How to check for attributes using the extension methods.
&lt;/span&gt;&lt;span style="color: blue;"&gt;bool&lt;/span&gt; hasMarkerAttribute = instance.HasAttribute&amp;lt;&lt;span style="color: #2b91af;"&gt;MyMarkerAttribute&lt;/span&gt;&amp;gt;();

&lt;span style="color: green;"&gt;// How to check for marker interface using unfair compiler sugar. ;)
&lt;/span&gt;&lt;span style="color: blue;"&gt;bool&lt;/span&gt; hasMarkerInterface = instance &lt;span style="color: blue;"&gt;is&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IMyMarkerInterface&lt;/span&gt;; &lt;span style="color: green;"&gt;// Not that much shorter, right?
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;
Well, I hope someone can use this… Any thoughts or criticisms for the code will be greatly appreciated. Otherwise, enjoy! ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-2007294977726220559?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QbBKjcKZepS7wR3-4-tC6--nNfo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QbBKjcKZepS7wR3-4-tC6--nNfo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QbBKjcKZepS7wR3-4-tC6--nNfo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QbBKjcKZepS7wR3-4-tC6--nNfo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=qQMZBuHm"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=642Uc55d"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=642Uc55d" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=XbNCCTWG"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=XbNCCTWG" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/RqiFeGi8pdY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/2007294977726220559/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/2007294977726220559?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/2007294977726220559?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/RqiFeGi8pdY/extension-types-for-easier-and-strongly.html" title="Extension Types for easier (and strongly typed) Attribute checks" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QCSXw9fSp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-4230693584984675234</id><published>2008-06-06T11:38:00.002+02:00</published><updated>2008-07-30T16:49:28.265+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:49:28.265+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="LINQ" /><title>Exciting times</title><content type="html">It's a very exciting time to be a developer right now with all the new stuff that inches closer to completion... ReSharper 4 just hit &lt;a class="null" href="http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+4.0+Nightly+Builds" target="_blank"&gt;RC2&lt;/a&gt;, &lt;a class="null" href="http://www.silverlight.net/" target="_blank"&gt;Silverlight 2&lt;/a&gt; will come with a beta 2 any second now, &lt;a class="null" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=8C36ACA4-E947-4760-9B05-93CAC04C6F87&amp;amp;displaylang=en" target="_blank"&gt;SP1&lt;/a&gt; for .NET 3.5 and VS2008 is not too far out in the horizon, and there are a ton of recently updated CTPs floating around. It's very exciting to see how the future is shaping up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-4230693584984675234?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gX7HPbnTZVMLKECp8WY-h0Yt8dg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gX7HPbnTZVMLKECp8WY-h0Yt8dg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gX7HPbnTZVMLKECp8WY-h0Yt8dg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gX7HPbnTZVMLKECp8WY-h0Yt8dg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=7cfcEMl4"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=1MokiCyj"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=1MokiCyj" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=R1uaZFmu"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=R1uaZFmu" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/MnFf6gbmTvE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/4230693584984675234/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/06/exciting-times.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/4230693584984675234?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/4230693584984675234?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/MnFf6gbmTvE/exciting-times.html" title="Exciting times" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/06/exciting-times.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QHRHozeip7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-3391960988859466662</id><published>2008-04-30T13:15:00.004+02:00</published><updated>2008-07-30T16:48:55.482+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:48:55.482+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Host name problems in WCF service metadata</title><content type="html">I just solved a little issue a customer had in a project where the addresses in the metadata of a WCF service were pointing to an internal address instead of the external public address. For an example let's say that we have an IIS server which external address is: &lt;a href="https://www.example.com/problem.svc"&gt;https://www.example.com/problem.svc&lt;/a&gt; and on the internal network the server is called: &lt;a href="https://iis.production/problem.svc"&gt;https://iis.production/problem.svc&lt;/a&gt;. The service is configured like so:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;services&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;service&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;Example.ProblemService&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;behaviorConfiguration&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;CustomBehavior&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;endpoint&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;contract&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;Example.IProblemService&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;binding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;wsHttpBinding&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;bindingConfiguration&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;ssl&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; /&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;endpoint&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;contract&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;IMetadataExchange&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;binding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;mexHttpBinding&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;address&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;mex&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;service&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;services&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;

  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;bindings&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;wsHttpBinding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;binding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;ssl&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;security&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;mode&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;Transport&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;transport&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;clientCredentialType&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;None&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;security&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;binding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;wsHttpBinding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;bindings&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;

  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;behaviors&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;serviceBehaviors&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;behavior&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;CustomBehavior&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;serviceMetadata&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;httpGetEnabled&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;"&lt;span style="color: rgb(0, 0, 255);"&gt; /&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;behavior&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;serviceBehaviors&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;behaviors&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
Now the problem first shows its ugly face when you go to the external address (&lt;a href="https://www.example.com/problem.svc"&gt;https://www.example.com/problem.svc&lt;/a&gt;) where the following text will meet you:&lt;br /&gt;
&lt;blockquote&gt;You have created a service. &lt;br /&gt;
&lt;br /&gt;
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:&lt;br /&gt;
&lt;pre&gt;svcutil.exe &lt;a href="https://test.loplus.lo.dk/ServiceAfdeling.svc?wsdl"&gt;&lt;/a&gt;&lt;a href="https://www.example.com/problem.svc"&gt;&lt;/a&gt;&lt;a href="https://iis.production/problem.svc"&gt;https://iis.production/problem.svc&lt;/a&gt;&lt;a href="http://draft.blogger.com/post-edit.g?blogID=7106856618803377357&amp;amp;postID=3391960988859466662"&gt;&lt;/a&gt;?wsdl&lt;a href="http://draft.blogger.com/post-edit.g?blogID=7106856618803377357&amp;amp;postID=3391960988859466662"&gt;&lt;/a&gt;&lt;/pre&gt;&lt;/blockquote&gt;See the problem? It is exposing the internal address instead of the external address. "No problem, I'll just rewrite the path manually", you might say. And yes, you can rewrite the path manually but then you'll find that the WSDL also contains some internal references such as:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;lt;xsd:import schemaLocation="&lt;b&gt;&lt;a href="https://test.loplus.lo.dk/ServiceAfdeling.svc?wsdl"&gt;&lt;/a&gt;&lt;a href="https://www.example.com/problem.svc"&gt;&lt;/a&gt;&lt;a href="https://iis.production/problem.svc?xsd=xsd1"&gt;https://iis.production/problem.svc?xsd=xsd1&lt;/a&gt;&lt;a href="http://draft.blogger.com/post-edit.g?blogID=7106856618803377357&amp;amp;postID=3391960988859466662"&gt;&lt;/a&gt;?xsd=xsd1&lt;a href="http://draft.blogger.com/post-edit.g?blogID=7106856618803377357&amp;amp;postID=3391960988859466662"&gt;&lt;/a&gt;&lt;/b&gt;" .../&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;lt;soap12:address location="&lt;/i&gt;&lt;a href="https://test.loplus.lo.dk/ServiceAfdeling.svc?wsdl"&gt;&lt;/a&gt;&lt;a href="https://www.example.com/problem.svc"&gt;&lt;/a&gt;&lt;a href="https://iis.production/problem.svc"&gt;&lt;i&gt;https://iis.production/problem.svc&lt;/i&gt;&lt;/a&gt;&lt;a href="http://draft.blogger.com/post-edit.g?blogID=7106856618803377357&amp;amp;postID=3391960988859466662"&gt;&lt;/a&gt;&lt;a href="http://draft.blogger.com/post-edit.g?blogID=7106856618803377357&amp;amp;postID=3391960988859466662"&gt;&lt;/a&gt;&lt;i&gt;" /&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
So how do we solve this problem? I first thought I could solve it with configuration. So I tried a heap of things like adding base addresses and using the httpsGetUrl property which actually got really close to solving the problem but unfortunately still left a few internal references in the WSDL.&lt;br /&gt;
&lt;br /&gt;
So what can you do? Googling the problem didn't turn up much help but a few people mentioned that adding a host header to IIS might solve the problem... So I tried that, but that didn't have any effect. However, this would have solved the problem if my site wasn't running SSL. If you have a SSL site you have to run a rather obscure command from the command prompt to set the host header:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;adsutil set /w3svc/{site identifier}/SecureBindings ":{port}:{host header}"&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
so in my example the command looked like this:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;adsutil set /w3svc/1/SecureBindings ":443:www.example.com"&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
That's it! It took me about 3 hours of trial and error to get this issue fixed so I hope this post will help you get there a little faster. ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-3391960988859466662?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Xxm6VMQByLzmrSg1yIgUa4-Lhyc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Xxm6VMQByLzmrSg1yIgUa4-Lhyc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Xxm6VMQByLzmrSg1yIgUa4-Lhyc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Xxm6VMQByLzmrSg1yIgUa4-Lhyc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=1YVzcbSk"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=PPEcNxpv"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=PPEcNxpv" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=pLG9qE9a"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=pLG9qE9a" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/1z7Det0Jt1k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/3391960988859466662/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/07/host-name-problems-in-wcf-service.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/3391960988859466662?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/3391960988859466662?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/1z7Det0Jt1k/host-name-problems-in-wcf-service.html" title="Host name problems in WCF service metadata" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/07/host-name-problems-in-wcf-service.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cGR3c6fyp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-6653747169757333347</id><published>2008-03-06T01:12:00.001+01:00</published><updated>2008-07-30T16:43:46.917+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:43:46.917+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IE" /><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><title>IE8 and Silverlight 2.0 betas for developers released and I will not have a computer in sight for the next 4 days... D'oh!</title><content type="html">I was just browsing the web for a last time before I am going on a teambuilding trip to Ljubljana, Slovenia for the next four days and what a big bag of bad timing I was in for… Apparently the teams responsible for IE8 and Silverlight 2.0 decided to release their first betas the very night before I am going on a tech-free business trip! I guess I will just have to wait for 4 days before my excruciating impatience for trying out the exciting new stuff in both releases will be relieved. So it seems like you guys will get a head start on these releases. Enjoy! ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-6653747169757333347?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P11udBB_rnYNy8TpGrL6mFOcHqw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P11udBB_rnYNy8TpGrL6mFOcHqw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P11udBB_rnYNy8TpGrL6mFOcHqw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P11udBB_rnYNy8TpGrL6mFOcHqw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=kQLJqAzc"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=BMI7p4sC"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=BMI7p4sC" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=IgFcRa86"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=IgFcRa86" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/phhRs6_x4Ls" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/6653747169757333347/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/03/ie8-and-silverlight-20-betas-for.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/6653747169757333347?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/6653747169757333347?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/phhRs6_x4Ls/ie8-and-silverlight-20-betas-for.html" title="IE8 and Silverlight 2.0 betas for developers released and I will not have a computer in sight for the next 4 days... D&amp;#39;oh!" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/03/ie8-and-silverlight-20-betas-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4NR3c5eip7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-1346942412325157764</id><published>2008-03-04T22:26:00.001+01:00</published><updated>2008-07-30T16:43:16.922+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:43:16.922+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IE" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><title>IE8 will default to the most standards compliant HTML interpreter</title><content type="html">Just to let you guys know… Dean Hachamovitch, general manager for the IE team, &lt;a href="http://blogs.msdn.com/ie/archive/2008/03/03/microsoft-s-interoperability-principles-and-ie8.aspx"&gt;just announced&lt;/a&gt; that IE8, regardless of &lt;a href="http://blogs.msdn.com/ie/archive/2008/01/21/compatibility-and-ie8.aspx"&gt;earlier statements&lt;/a&gt;, will render web content the most standards compliant way by default. This statement, along with &lt;a href="http://blogs.msdn.com/ie/archive/2007/12/19/internet-explorer-8-and-acid2-a-milestone.aspx"&gt;the ACID2 compliance achievement&lt;/a&gt;, is a clear indication of the IE teams recent increased focus on standards compliance. I wholeheartedly welcome this change in Microsoft’s policy for interoperability.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-1346942412325157764?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/H3EdVYMjR7Sg7rml_Kxwa2xVhHY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H3EdVYMjR7Sg7rml_Kxwa2xVhHY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/H3EdVYMjR7Sg7rml_Kxwa2xVhHY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H3EdVYMjR7Sg7rml_Kxwa2xVhHY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=esx1dvZW"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=Fs2mCyNd"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=Fs2mCyNd" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=sltatUbq"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=sltatUbq" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/P8d4gCIFzJY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/1346942412325157764/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/03/ie8-will-default-to-most-standards.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/1346942412325157764?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/1346942412325157764?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/P8d4gCIFzJY/ie8-will-default-to-most-standards.html" title="IE8 will default to the most standards compliant HTML interpreter" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/03/ie8-will-default-to-most-standards.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4BQ3c_cCp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-9034349116851594242</id><published>2008-02-29T07:15:00.001+01:00</published><updated>2008-07-30T16:42:32.948+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:42:32.948+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="WCSF" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="Patterns and Practices" /><title>Web Client Software Factory 2.0 has shipped!</title><content type="html">According to &lt;a href="http://blogs.msdn.com/gblock/archive/2008/02/28/web-client-software-factory-2-0-shipped.aspx" target="_blank"&gt;Glenn Block&lt;/a&gt; the new version of WCSF has shipped and is ready for &lt;a href="http://msdn2.microsoft.com/en-us/library/bb264518.aspx" target="_blank"&gt;download from MSDN&lt;/a&gt;. I encourage you to take a look at it. Oh, what a nice set-up for the weekend. ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-9034349116851594242?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vvuZUmOC0muvsT3OB8PMBgJ5KCs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vvuZUmOC0muvsT3OB8PMBgJ5KCs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vvuZUmOC0muvsT3OB8PMBgJ5KCs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vvuZUmOC0muvsT3OB8PMBgJ5KCs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=4SIQNnFz"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=AX8pHIlq"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=AX8pHIlq" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=PyChk8lX"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=PyChk8lX" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/6earze4Erk4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/9034349116851594242/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/02/web-client-software-factory-20-has.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/9034349116851594242?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/9034349116851594242?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/6earze4Erk4/web-client-software-factory-20-has.html" title="Web Client Software Factory 2.0 has shipped!" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/02/web-client-software-factory-20-has.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8MQHc7fSp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-5251182310830202582</id><published>2008-02-28T05:46:00.001+01:00</published><updated>2008-07-30T16:41:21.905+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:41:21.905+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ITU" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="C5" /><title>The C5 Collections Extravaganza!</title><content type="html">Have you ever been in the situation where you thought that the built in collection types in the .NET framework just didn’t cut it? Fret no more; the fine folks at the &lt;a href="http://www.itu.dk/"&gt;IT University of Copenhagen&lt;/a&gt; have built &lt;a href="http://www.itu.dk/research/c5/"&gt;The C5 Generic Collection Library&lt;/a&gt; to fill in the gaps of, and improve on, the standard .NET framework collection types. C5 is truly an awesome library and I wholly recommend that you check out the &lt;a href="http://www.itu.dk/research/c5/"&gt;C5 site&lt;/a&gt; and the accompanying manual (272 pages!) describing the library. If you like video more than reading you can check out the &lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=370368"&gt;Channel9 interview with Peter Sestoft&lt;/a&gt;, which is one of the main guys behind the C5 library.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-5251182310830202582?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DnqwgKUE_PnXChbKnCVJGkosqx0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DnqwgKUE_PnXChbKnCVJGkosqx0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DnqwgKUE_PnXChbKnCVJGkosqx0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DnqwgKUE_PnXChbKnCVJGkosqx0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=UK3a9qgE"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=k3FZTE1Z"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=k3FZTE1Z" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=zuo1OLN5"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=zuo1OLN5" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/WpBdKCbSe9A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/5251182310830202582/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/02/c5-collections-extravaganza.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/5251182310830202582?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/5251182310830202582?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/WpBdKCbSe9A/c5-collections-extravaganza.html" title="The C5 Collections Extravaganza!" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/02/c5-collections-extravaganza.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8ESH07cSp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-1952222843525307058</id><published>2008-02-25T14:51:00.002+01:00</published><updated>2008-07-30T16:40:09.309+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:40:09.309+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="WCSF" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="Patterns and Practices" /><title>Gax/Gat 1.4 Final Released (Well... a week ago, anyway) Web Client Software Factory 2.0 just around the corner</title><content type="html">A semi-important event transpired last week that almost didn't get any press from the blogging community or anyone else for that matter. I might just have missed the news since I was a little stressed last week, and if it wasn't for a fluke coincidence I probably still wouldn’t have known about it. “So what is this important event you talk of?” I hear you ask. Well, the event was the release of the final version 1.4 of the Patterns &amp;amp; Practices’ GAX/GAT tools. If you don’t know what either GAX or GAT are, here is the 10 second description. &lt;br /&gt;
&lt;br /&gt;
“GAX” stands for “Guidance Automation eXtensions” and “GAT” stands for “Guidance Automation Toolkit”. These&amp;nbsp;are a set of plug-ins and tools by the Patterns &amp;amp; Practices group in Microsoft for Visual Studio that enables you (the architect or senior developer) to write guidance packages for your development team. “GAX” enables the developer to use/execute the guidance packages while “GAT” enables you to actually develop them. &lt;br /&gt;
&lt;br /&gt;
To read more about what guidance packages are, I'll direct you to the &lt;a href="http://msdn2.microsoft.com/en-us/teamsystem/aa718948.aspx" target="_blank"&gt;P&amp;amp;P site&lt;/a&gt;, which also have the &lt;a href="http://msdn2.microsoft.com/en-us/teamsystem/aa718949.aspx" target="_blank"&gt;download links&lt;/a&gt; for the new version of GAX/GAT.&lt;br /&gt;
&lt;br /&gt;
The highlights of this GAX/GAT release are: &lt;br /&gt;
&lt;br /&gt;
1. It’s final... This is important because all the previous versions of GAX/GAT have been labeled “Beta” or “CTP”. However, the details about what this change in labeling actually means are still a little sketchy. Will MS commit to the product or how should we interpret this “Final” label? However I think it is probably for the better. I mean, It's always rather difficult to sell a CTP or Beta solution to my boss, even though a "CTP" or "Beta", in P&amp;amp;P terms, is probably as good as any product most companies would ship. &lt;br /&gt;
&lt;br /&gt;
2. It now supports both VS2005 and VS2008. &lt;br /&gt;
&lt;br /&gt;
3. Various bug fixes. &lt;br /&gt;
&lt;br /&gt;
“That doesn't sound like much... So what’s all the fuzz about?” you ask. Well, apart from GAX/GAT being a very powerful and interesting concept, the release of version 1.4 enables another even more interesting project to be completed. Namely the Web Client Software Factory 2.0. This project hasn’t been able to ship, due to some issues in GAX/GAT. But now the problems are solved and WCSF 2.0 is just around the corner according to Glenn Block from the P&amp;amp;P group. The &lt;a href="http://blogs.msdn.com/gblock/archive/2008/02/22/web-client-2-0-what-s-the-hold-up.aspx" target="_blank"&gt;latest news&lt;/a&gt; on Glenn’s blog was that WCSF 2.0 is shipping sometime this week!!! &lt;br /&gt;
&lt;br /&gt;
If you don’t know what the WCSF project is all about and why I think this is important news, I strongly encourage you to check out the &lt;a href="http://www.codeplex.com/websf" target="_blank"&gt;WCSF CodePlex site&lt;/a&gt;. I also encourage you to check out the other software factories such as the “&lt;a href="http://www.codeplex.com/servicefactory" target="_blank"&gt;Web Service Software Factory&lt;/a&gt;” or the “&lt;a href="http://www.codeplex.com/smartclient" target="_blank"&gt;Smart Client Software Factory&lt;/a&gt;”.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-1952222843525307058?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zE-raKnc34R0C-VAl50B1sK9HLM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zE-raKnc34R0C-VAl50B1sK9HLM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zE-raKnc34R0C-VAl50B1sK9HLM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zE-raKnc34R0C-VAl50B1sK9HLM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=aKe2aITB"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=3oAEesQM"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=3oAEesQM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=0H5Pa0OO"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=0H5Pa0OO" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/FE7VDMtcy30" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/1952222843525307058/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/02/gaxgat-14-final-released-well-week-ago.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/1952222843525307058?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/1952222843525307058?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/FE7VDMtcy30/gaxgat-14-final-released-well-week-ago.html" title="Gax/Gat 1.4 Final Released (Well... a week ago, anyway) Web Client Software Factory 2.0 just around the corner" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/02/gaxgat-14-final-released-well-week-ago.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAFQ34zfyp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-9024441415429186420</id><published>2007-12-13T23:47:00.002+01:00</published><updated>2008-07-30T16:38:32.087+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:38:32.087+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="XNA" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><title>Final release of XNA Game Studio 2.0!</title><content type="html">Take a look at &lt;a href="http://blogs.msdn.com/xna/archive/2007/12/13/xna-game-studio-2-0-released.aspx"&gt;this&lt;/a&gt; post from the XNA team. As the title might indicate they just released the final (RTM) version of XNA Game Studio 2.0. Unfortunately this version of XNA GS "only" works against any VS2005 version, it's still a step up from the express only version we had earlier, but I'm still looking forward to getting rid of VS2005 and start using VS2008 exclusivly. Atm, only XNA GS 2.0 and Resharper is keeping me from that goal and I hope that both of these issues will be resolved before Q2 2008.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://creators.xna.com/Education/newtoxna.aspx"&gt;Download XNA Game Studio 2.0&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-9024441415429186420?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JEl4vmFGbtp0umqhkN-t7TsPONo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JEl4vmFGbtp0umqhkN-t7TsPONo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JEl4vmFGbtp0umqhkN-t7TsPONo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JEl4vmFGbtp0umqhkN-t7TsPONo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=oHqEmXNo"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=bUXuQUsn"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=bUXuQUsn" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=Gj98zlwz"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=Gj98zlwz" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/FpVdCOgjvso" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/9024441415429186420/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2007/12/final-release-of-xna-game-studio-20.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/9024441415429186420?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/9024441415429186420?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/FpVdCOgjvso/final-release-of-xna-game-studio-20.html" title="Final release of XNA Game Studio 2.0!" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2007/12/final-release-of-xna-game-studio-20.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4HRH06eSp7ImA9WxVRGEs.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-4253257523737925315</id><published>2007-11-12T11:16:00.000+01:00</published><updated>2009-01-25T06:55:35.311+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-25T06:55:35.311+01:00</app:edited><title>The Blogger-FeedBurner-Reader triangle of pure blog power</title><content type="html">&lt;div style="margin: 1em; display: block; float: right" class="zemanta-img"&gt;&lt;a href="http://lh6.ggpht.com/_ISKqZTs_ztc/SRFyaNmc3PI/AAAAAAAAAs8/X_yyDWlle_g/s1600-h/triangle%5B19%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="Reader, Blogger, FeedBurner" border="0" alt="Reader, Blogger, FeedBurner" src="http://lh3.ggpht.com/_ISKqZTs_ztc/SRFyaoGrhkI/AAAAAAAAAtE/45eugDhYC0o/triangle_thumb%5B21%5D.png?imgmax=800" width="149" height="199" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;p&gt;I recently moved my blog from the Danish .NET community &lt;a target="_blank" href="http://www.dotnetforum.dk"&gt;DotNetForum.dk&lt;/a&gt; to &lt;a target="_blank" href="http://www.blogger.com/"&gt;Blogger.com&lt;/a&gt;. The reason for doing this was that Blogger is an extremely customizable blog engine and after Google has acquired&amp;#160; Blogger I bet that the reliability, quality and performance will get a significant boost.&lt;/p&gt;&lt;p&gt;The second reason for moving to Blogger is another Google acquisition, namely &lt;a target="_blank" href="http://feedburner.google.com/"&gt;FeedBurner&lt;/a&gt;. I was already using FeedBurner on my old blog but since Google now owns both Blogger and FeedBurner I bet the integration story between those two technologies will be much better in the future. So I’ve simply positioned my blog in a spot that I expect will provide the best/most features, as well as high reliability, quality and performance.&lt;/p&gt;&lt;p&gt;To top that off Google also has the awesome &lt;a target="_blank" href="http://reader.google.com/"&gt;Google Reader&lt;/a&gt; application which also integrates nicely with both Blogger and FeedBurner. This integration story will also just get better as time goes on.&lt;/p&gt;&lt;p&gt;The conclusion is that I think that Google has started a very powerful blogging story now and it has only just begun…&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-4253257523737925315?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QCgEMT2cSmWkEYd_R6caM_apHm8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QCgEMT2cSmWkEYd_R6caM_apHm8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QCgEMT2cSmWkEYd_R6caM_apHm8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QCgEMT2cSmWkEYd_R6caM_apHm8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=n2o8QBi2"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=mGXPlogt"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=mGXPlogt" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=qvob9iFa"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=qvob9iFa" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/X3H3irQsNEE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/4253257523737925315/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/11/blogger-feedburner-reader-triangle-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/4253257523737925315?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/4253257523737925315?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/X3H3irQsNEE/blogger-feedburner-reader-triangle-of.html" title="The Blogger-FeedBurner-Reader triangle of pure blog power" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/11/blogger-feedburner-reader-triangle-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkECQXw5cCp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-6436750651335560031</id><published>2007-08-21T23:22:00.004+02:00</published><updated>2008-07-30T16:37:40.228+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:37:40.228+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="LINQ" /><title>How about LinqToStrings?</title><content type="html">I was playing around with Orcas Beta 2 and Linq queries just now and I thought of a new way of (&lt;i&gt;mis&lt;/i&gt;)using linq queries... Check it out:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; text = &lt;span style="color: rgb(163, 21, 21);"&gt;"Johannes Hansen, 1980"&lt;/span&gt;;

&lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; query =
&lt;span style="color: rgb(0, 0, 255);"&gt;  from&lt;/span&gt; c &lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt; text
&lt;span style="color: rgb(0, 0, 255);"&gt;  where&lt;/span&gt; !&lt;span style="color: rgb(43, 145, 175);"&gt;Char&lt;/span&gt;.IsSeparator(c)
&lt;span style="color: rgb(0, 0, 255);"&gt;  group&lt;/span&gt; c &lt;span style="color: rgb(0, 0, 255);"&gt;by&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Char&lt;/span&gt;.ToUpper(c) &lt;span style="color: rgb(0, 0, 255);"&gt;into&lt;/span&gt; charGroup
&lt;span style="color: rgb(0, 0, 255);"&gt;  select&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;new
&lt;/span&gt;  {
    Char = charGroup.Key.ToString(),
    Count = charGroup.Count()
  };

query.ForEach(item =&amp;gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"'{0}' occurs {1} time(s) in the string"&lt;/span&gt;, item.Char, item.Count));
&lt;/pre&gt;&lt;br /&gt;
The output of this code is:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;'J' occurs 1 time(s) in the string
'O' occurs 1 time(s) in the string
'H' occurs 2 time(s) in the string
'A' occurs 2 time(s) in the string
'N' occurs 4 time(s) in the string
'E' occurs 2 time(s) in the string
'S' occurs 2 time(s) in the string
',' occurs 1 time(s) in the string
'1' occurs 1 time(s) in the string
'9' occurs 1 time(s) in the string
'8' occurs 1 time(s) in the string
'0' occurs 1 time(s) in the string
&lt;/pre&gt;&lt;br /&gt;
So, are LINQ queries useful as a practical way of doing string parsing? Not really, no... At least I don't think so. However, it demonstrates that linq can be used for other scenarios than databases and xml. Also, please note that the "ForEach" extension method was implemented by me. It also doesn't really serve any useful purpose other than to test extension methods... It's implemented like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;CustomExtensions
&lt;/span&gt;{
&lt;span style="color: rgb(0, 0, 255);"&gt;  public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; ForEach&amp;lt;TSource&amp;gt;(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;IEnumerable&lt;/span&gt;&amp;lt;TSource&amp;gt; source, &lt;span style="color: rgb(43, 145, 175);"&gt;Action&lt;/span&gt;&amp;lt;TSource&amp;gt; action)
  {
&lt;span style="color: rgb(0, 0, 255);"&gt;    if&lt;/span&gt; (source == &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;)
&lt;span style="color: rgb(0, 0, 255);"&gt;      throw&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"source"&lt;/span&gt;);

&lt;span style="color: rgb(0, 0, 255);"&gt;    if&lt;/span&gt; (action == &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;)
&lt;span style="color: rgb(0, 0, 255);"&gt;      throw&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"action"&lt;/span&gt;);

&lt;span style="color: rgb(0, 0, 255);"&gt;    foreach&lt;/span&gt; (TSource local &lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt; source)
      action(local);
  }
}
&lt;/pre&gt;&lt;br /&gt;
Without the "ForEach" extension method the last line of the first example could have been written as:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt; item &lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt; query)
&lt;span style="color: rgb(43, 145, 175);"&gt;  Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"'{0}' occurs {1} time(s) in the string"&lt;/span&gt;, item.Char, item.Count);&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-6436750651335560031?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gImhu5i9p14x8YbS2VBo8Q7SKi8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gImhu5i9p14x8YbS2VBo8Q7SKi8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gImhu5i9p14x8YbS2VBo8Q7SKi8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gImhu5i9p14x8YbS2VBo8Q7SKi8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=VR0oUeWb"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=VG23zkUV"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=VG23zkUV" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=NZQQ9Pch"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=NZQQ9Pch" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/eGmfzKQ7t8g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/6436750651335560031/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2007/08/how-about-linqtostrings.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/6436750651335560031?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/6436750651335560031?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/eGmfzKQ7t8g/how-about-linqtostrings.html" title="How about LinqToStrings?" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2007/08/how-about-linqtostrings.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUNQ3c8eyp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-8403657280351693272</id><published>2007-02-28T05:02:00.004+01:00</published><updated>2008-07-30T16:31:32.973+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:31:32.973+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><title>And so it begins... The quality pitfalls of the .NET compatibility strategy</title><content type="html">"The .NET framework is awesome." That has been my position for a few years now and probably will be for many years to come. Microsoft has done a great job of naming and segmenting the various classes and types into logical namespaces and type libraries. They are also holding true to the promise that backwards compatibility is key, which usually is a good thing. But unfortunately this rigidity is starting to degrade the tidiness and quality of the framework.&lt;br /&gt;
&lt;br /&gt;
As time goes by and innovations are made in the field of software development, various improvements are realized and implemented. However, because all the good names already are taken, the additional features in the framework are beginning to degrade in naming quality and the overall tidiness of the framework is suffering.&lt;br /&gt;
&lt;br /&gt;
One example could be the good old (original) DataGrid which got a new and improved little brother in ASP.NET 2.0 called the GridView. Now we have two grids, one of which is only left due to compatibility issues. In future editions of the .NET framework we will have to deal with extended/improved siblings such as the ListView vs. DataList and TimeZone2 vs. TimeZone. Personally I would rather have the various teams make a clean cut and stop cluttering the various namespaces with classes with similar functionality and names. Also, I don't mind them correcting some of the past mistakes as seen in the .NET framework "hall of shame". Maybe compatibility features could be pulled out into a separate library, like "System.Compatibility" (A "Sample.Web.UI.Compatibility" namespace were introduced in the first ajax release as a temporary validation bug fix). This could hide features for new development while making it easy for older applications to upgrade without having to rewrite the entire app.&lt;br /&gt;
&lt;br /&gt;
I realize that this strategy poses migration issues to development teams but tool support is often making migrating from one framework version to another hard if not impossible anyways. Also, when migrating from one version to another you do it with the intent to change the code to use new features anyways. Just to be clear, I don't mind backwards compatibility as long as it doesn't hurt the quality of the framework.&lt;br /&gt;
&lt;br /&gt;
What do you think?&lt;br /&gt;
&lt;br /&gt;
References:      &lt;br /&gt;
ListView: &lt;a href="http://www.asp.net/learn/webcasts/view.aspx?tabid=63&amp;amp;id=48"&gt;http://www.asp.net/learn/webcasts/view.aspx?tabid=63&amp;amp;id=48&lt;/a&gt;      &lt;br /&gt;
TimeZone2: &lt;a href="http://blogs.msdn.com/bclteam/archive/2006/10/03/System.TimeZone2-Starter-Guide-_5B00_Kathy-Kam_5D00_.aspx"&gt;http://blogs.msdn.com/bclteam/archive/2006/10/03/System.TimeZone2-Starter-Guide-_5B00_Kathy-Kam_5D00_.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-8403657280351693272?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8ra4PvwRY2m_KMR2_a4ESQ41Pjs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8ra4PvwRY2m_KMR2_a4ESQ41Pjs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8ra4PvwRY2m_KMR2_a4ESQ41Pjs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8ra4PvwRY2m_KMR2_a4ESQ41Pjs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=rHjlmRti"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=b1ppKykU"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=b1ppKykU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=PT3hKWyE"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=PT3hKWyE" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/U9v4LZj6roU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/8403657280351693272/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2007/02/and-so-it-begins-quality-pitfalls-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/8403657280351693272?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/8403657280351693272?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/U9v4LZj6roU/and-so-it-begins-quality-pitfalls-of.html" title="And so it begins... The quality pitfalls of the .NET compatibility strategy" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2007/02/and-so-it-begins-quality-pitfalls-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4HR385fCp7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-5272718774662044884</id><published>2007-01-14T06:48:00.008+01:00</published><updated>2008-07-30T16:25:36.124+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:25:36.124+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="WCSF" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="Patterns and Practices" /><title>Patterns &amp; Practices: Web Client Software Factory released!</title><content type="html">Så blev P&amp;amp;P gruppen i microsoft endelig færdig med deres seneste (mindre kendte) software factory til web clients (WCSF). Yipiie!!!&lt;br /&gt;
&lt;br /&gt;
WCSF er pakke guidelines til hvordan p&amp;amp;p gruppen mener man kan bygge en web applikation op&amp;nbsp;hvor man holder de forskellige lag i applikationen adskilt vha. det kendte MVP software pattern. WCSF er baseret på ASP.NET 2.0 men&amp;nbsp;bruger også .NET 3.0's workflow foundation komponent til at styre dele af navigationen i&amp;nbsp;en applikation med (kaldet PageFlow). Pakken integrerer sig med VS2005 og giver lidt ekstra hjælp til at oprette solutions, views, controllers og hvad der ellers måtte være af sære klasser...&lt;br /&gt;
&lt;br /&gt;
Dokumentationen til WCSF er meget spændende&amp;nbsp;læsning og jeg vil &lt;b&gt;stærkt&lt;/b&gt; anbefale alle der laver web applikationer som et levebrød at tage et kig på WCSF. Man &lt;span style="text-decoration: underline;"&gt;skal&lt;/span&gt; jo ikke følge det til punkt og prikke men det kan da i det mindste give lidt stof til eftertanke.&lt;br /&gt;
&lt;br /&gt;
WCSF Home: &lt;a href="http://www.codeplex.com/websf"&gt;http://www.codeplex.com/websf&lt;/a&gt;&lt;br /&gt;
WCSF Download: &lt;a href="http://www.codeplex.com/websf/Project/FileDownload.aspx?DownloadId=5532"&gt;http://www.codeplex.com/websf/Project/FileDownload.aspx?DownloadId=5532&lt;/a&gt;&amp;nbsp;(doc included)&lt;br /&gt;
Separate WCSF docs Download: &lt;a href="http://www.codeplex.com/websf/Project/FileDownload.aspx?DownloadId=5531"&gt;http://www.codeplex.com/websf/Project/FileDownload.aspx?DownloadId=5531&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-5272718774662044884?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/L_yNMF_6aczhvdR9VewLL65ipXQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L_yNMF_6aczhvdR9VewLL65ipXQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/L_yNMF_6aczhvdR9VewLL65ipXQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L_yNMF_6aczhvdR9VewLL65ipXQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=QhvMZWcm"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=2sL5eCu6"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=2sL5eCu6" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=BcUuQ2zH"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=BcUuQ2zH" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/y9orRFxIBlI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/5272718774662044884/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2008/07/patterns-practices-web-client-software.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/5272718774662044884?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/5272718774662044884?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/y9orRFxIBlI/patterns-practices-web-client-software.html" title="Patterns &amp; Practices: Web Client Software Factory released!" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2008/07/patterns-practices-web-client-software.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAASX85fip7ImA9WxdUFE8.&quot;"><id>tag:blogger.com,1999:blog-7106856618803377357.post-2674523004952241702</id><published>2006-12-01T18:41:00.006+01:00</published><updated>2008-07-30T16:22:28.126+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T16:22:28.126+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Vista" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft" /><title>Windows Vista speech recognition</title><content type="html">This message was written using speech recognition in Windows vista. Speech recognition in Windows Vista has been improved immensely over competing products. Unfortunately speech recognition doesn't recognize danish as of yet.&lt;br /&gt;
&lt;br /&gt;
Kind regards,&lt;br /&gt;
Johannes Hansen&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7106856618803377357-2674523004952241702?l=blog.johannesh.dk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iLZnOLd2KMX8QjLyIQgUz2txSPk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iLZnOLd2KMX8QjLyIQgUz2txSPk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iLZnOLd2KMX8QjLyIQgUz2txSPk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iLZnOLd2KMX8QjLyIQgUz2txSPk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=yQrU79Zp"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=uYeXiSt6"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=uYeXiSt6" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.johannesh.dk/~f/JohannesHansensBlog?a=R8kQwmap"&gt;&lt;img src="http://feeds.feedburner.com/~f/JohannesHansensBlog?i=R8kQwmap" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JohannesHansensBlog/~4/Uod_y2QFzO4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.johannesh.dk/feeds/2674523004952241702/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.johannesh.dk/2006/12/windows-vista-speech-recognition.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/2674523004952241702?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7106856618803377357/posts/default/2674523004952241702?v=2" /><link rel="alternate" type="text/html" href="http://feeds.johannesh.dk/~r/JohannesHansensBlog/~3/Uod_y2QFzO4/windows-vista-speech-recognition.html" title="Windows Vista speech recognition" /><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14894718248615142588" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.johannesh.dk/2006/12/windows-vista-speech-recognition.html</feedburner:origLink></entry></feed>
