<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Weblogs</title><link>http://weblogs.asp.net/default.aspx?GroupID=4</link><description>ASP.NET Community Bloggers</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Daily tech links for .net and related technologies - Feb 10-12, 2010</title><link>http://weblogs.asp.net/sanjeevagarwal/archive/2010/02/10/daily-tech-links-for-net-and-related-technologies-feb-10-12-2010.aspx</link><pubDate>Wed, 10 Feb 2010 06:58:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7341774</guid><dc:creator>SanjeevAgarwal</dc:creator><author>SanjeevAgarwal</author><slash:comments>1</slash:comments><description>Daily tech links for .net and related technologies - Feb 10-12, 2010 Web Development 'Unobtrusive' asynchronous Form in ASP.NET MVC - Tomasz Peczek ASP.NET MVC security checklist Multi-tenancy in ASP.NET MVC - Views - Rob Ashton Default Values in ASP.NET MVC Action Parameters - David Hayden Quick Tips About ASP.NET MVC – UI Helpers and Templates - Nuno Silva Quick Tips About ASP.NET MVC – Editor Templates - Nuno Silva ASP.NET MVC Quick Tips – Pass data to your master page -Nuno Silva ASP.NET MVC...(&lt;a href="http://weblogs.asp.net/sanjeevagarwal/archive/2010/02/10/daily-tech-links-for-net-and-related-technologies-feb-10-12-2010.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7341774" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/JQuery/default.aspx">JQuery</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/WCF/default.aspx">WCF</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/MVC/default.aspx">MVC</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Ajax/default.aspx">Ajax</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Entity+Framework/default.aspx">Entity Framework</category></item><item><title>Architect 3 : Building Data Access Layer Using Microsoft Enterprise Library 4.1</title><link>http://weblogs.asp.net/stanleygu/archive/2010/02/09/architect-3-building-data-access-layer-using-microsoft-enterprise-library.aspx</link><pubDate>Wed, 10 Feb 2010 01:52:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7341501</guid><dc:creator>StanleyGu</dc:creator><author>StanleyGu</author><slash:comments>0</slash:comments><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;You have a Customer table with three fields: ID, LastName and FirstName. You are building a data access layer to retrieve all the records from the Customer table and return the result as a collection of Customer objects.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You want implement it using Microsoft Enterprise Library.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;In your Data Access Layer project, add references to the following Microsoft Enterprise Library DLLs:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;Microsoft.Practices.EnterpriseLibrary.Data.dll&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;Microsoft.Practices.EnterpriseLibrary.Common.dll&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;Microsoft.Practices.ObjectBuilder2.dll&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;At App.config or Web.config, add the following dataConfiguration section:&lt;/FONT&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt; &lt;IMG src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL1.gif" mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL1.gif"&gt; 
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;3.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;At App.config or Web.config, add the following connectionString:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;IMG style="WIDTH: 481px; HEIGHT: 94px" height=94 src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL2.gif" width=481 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL2.gif"&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;4.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;At the Data Entity Layer, create a entity class Customer:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp; &lt;IMG style="WIDTH: 333px; HEIGHT: 94px" height=94 src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL3.gif" width=333 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL3.gif"&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;5.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;At the Data Access Layer, create a class CustomerDAL and make sure put the following using statements:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL4.gif" mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL4.gif"&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;6.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Create a method GetCustomers in the CustomerDAL class with the following implementation:&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG style="WIDTH: 526px; HEIGHT: 418px" height=418 src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL5.gif" width=526 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100209_DAL5.gif"&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7341501" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/stanleygu/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/stanleygu/archive/tags/Architect/default.aspx">Architect</category><category domain="http://weblogs.asp.net/stanleygu/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://weblogs.asp.net/stanleygu/archive/tags/Enterprise+Library/default.aspx">Enterprise Library</category></item><item><title>Most interesting from SharePoint 2010 Virtual Ignite Training: 2nd Day</title><link>http://weblogs.asp.net/jevgeni/archive/2010/02/09/most-interesting-from-sharepoint-2010-virtual-ignite-training-2nd-day.aspx</link><pubDate>Tue, 09 Feb 2010 15:53:05 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7340749</guid><dc:creator>Jevgeni Borozna</dc:creator><author>Jevgeni Borozna</author><slash:comments>1</slash:comments><description>&lt;p&gt;9 feb 2010: Virtual SharePoint 2010 Ignite Training for Developer&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Notes:&lt;/em&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Intellisense when editing Wiki-pages and other type of pages and inserting some page property. (When writing “[[&amp;quot;…)&lt;/li&gt;    &lt;li&gt;4 default Master Pages:&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;v4.master (default for SP 2010)&lt;/li&gt;      &lt;li&gt;minimal.master&lt;/li&gt;      &lt;li&gt;simple.master (For error pages or login pages. Not customizable, but pages can be replaced)&lt;/li&gt;      &lt;li&gt;default.master (Old-style master page, as in SP 2007. Without ribbon and other new things. For supporting SP 2007 projects when migrating them)&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;New Rich Text Editor supports XHTML (source is a valid XHTML)&lt;/li&gt;    &lt;li&gt;User Custom Action can be scoped to list / site / site-collection&lt;/li&gt;    &lt;li&gt;Multiple forms per type (many New, Display or Edit or other type of forms per List or Library). On of them must be set as default form for each type (New, Display, etc)&lt;/li&gt;    &lt;li&gt;Inline adding / editing items in a list (adding / editing items directly from List View, without opening New or Edit form)&lt;/li&gt;    &lt;li&gt;Rows conditional formatting in list view&lt;/li&gt;    &lt;li&gt;New properties on SPQuery:&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;SPQuery.Join&lt;/li&gt;      &lt;li&gt;SPQuery.ProjectedFields&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Use SPLinq instead of CAML to join lists (Building-time error &lt;em&gt;vs &lt;/em&gt;runtime error)&lt;/li&gt;    &lt;li&gt;Microsoft SharePoint Foundation 4.0 lists can now support 50M items&lt;/li&gt;    &lt;li&gt;Unique columns must be indexed (automatically configured)&lt;/li&gt;    &lt;li&gt;List Item Validation (Rule with formula. In SharePoint 2007 was possible to validate fields only)&lt;/li&gt;    &lt;li&gt;Silverlight Client Object Model&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;The web part can contain custom properties that are sent to Silverlight via the InitParameter property&lt;/li&gt;      &lt;li&gt;The XAP file can be deployed to LAYOUTS and loaded at run time&lt;/li&gt;      &lt;li&gt;The Silverlight application can then make use of the Client OM&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;ECMAScript Client Object Model&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;ECMAScript Client OM is easily added to SharePoint ASPX page - reference:&lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;_layouts/sp.js&lt;/li&gt;     &lt;/ul&gt;   &lt;/ul&gt;    &lt;li&gt;SPMetal utility generates Entities for all site things (Lists, fields, etc) for using them with SharePoint Linq&lt;/li&gt; &lt;/ul&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7340749" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jevgeni/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/ASP+.NET/default.aspx">ASP .NET</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/Tools/default.aspx">Tools</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/XML/default.aspx">XML</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/SharePoint+Foundation+2010/default.aspx">SharePoint Foundation 2010</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/WSS+3.0/default.aspx">WSS 3.0</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/Notes/default.aspx">Notes</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/Improvements/default.aspx">Improvements</category><category domain="http://weblogs.asp.net/jevgeni/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Visual Studio 2010 RC is out</title><link>http://weblogs.asp.net/jeevanmurkoth/archive/2010/02/09/visual-studio-2010-rc-is-out.aspx</link><pubDate>Tue, 09 Feb 2010 13:35:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7340558</guid><dc:creator>Jeev</dc:creator><author>Jeev</author><slash:comments>0</slash:comments><description>&lt;p&gt;Visual Studio Release Candidate is out. See the &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/02/08/vs-2010-net-4-release-candidate.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2010/02/08/vs-2010-net-4-release-candidate.aspx"&gt;post&lt;/a&gt; from Scott Guthrie. If you are interested in finding out what are the changes from VS 2008&amp;nbsp; or .NET 3.5; I strongly suggest that you check out&amp;nbsp; this series of &lt;a href="http://weblogs.asp.net/scottgu/archive/2009/08/25/vs-2010-and-net-4-series.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2009/08/25/vs-2010-and-net-4-series.aspx"&gt;blog posts&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Another &lt;a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/02/03/what-s-new-in-visual-studio-2010-more-than-you-may-realise.aspx" mce_href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/02/03/what-s-new-in-visual-studio-2010-more-than-you-may-realise.aspx"&gt;post &lt;/a&gt;from Mike Taulty listing out what is new &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7340558" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeevanmurkoth/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/jeevanmurkoth/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Visual Studio 2010 RC is available</title><link>http://weblogs.asp.net/gunnarpeipman/archive/2010/02/09/visual-studio-2010-rc-is-available.aspx</link><pubDate>Tue, 09 Feb 2010 09:30:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7340190</guid><dc:creator>DigiMortal</dc:creator><author>DigiMortal</author><slash:comments>8</slash:comments><description>&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="VS2010" border="0" alt="VS2010" align="left" src="http://weblogs.asp.net/blogs/gunnarpeipman/visualstudio2010small_7E0AD4B2.png" width="170" height="39" /&gt; &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;VS2010 RC&lt;/a&gt; is out now and available for MSDN users since now. Other guys have to wait until tomorrow when VS2010 RC is made publically available. Reading first news I discovered that most important thing is hardly improved performance of VS2010 RC IDE. All your feedback is welcome to &lt;a href="https://connect.microsoft.com/VisualStudio?wa=wsignin1.0"&gt;VS2010 RC Connect site&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;To find out more follow these links:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2010/02/08/vs-2010-net-4-release-candidate.aspx"&gt;VS 2010 / .NET 4 Release Candidate&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/bharry/archive/2010/02/08/vs-2010-net-4-release-candidate-is-available-for-msdn-subscribers.aspx"&gt;VS 2010/.NET 4 Release Candidate is Available for MSDN subscribers&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/jasonz/archive/2010/02/09/announcing-vs2010-net-framework-4-release-candidate-rc.aspx"&gt;Announcing VS2010 / .NET Framework 4 Release Candidate (RC)&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Before installing RC you must uninstall all previous versions of VS2010 and .NET Framework 4.0. It seems like another long nights of hacking and discovering new stuff are waiting for us. :)&lt;/p&gt;

&lt;hr size="1" /&gt;

&lt;table border="0" cellpadding="0" cellspacing="2" width="100%"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.asp.net%2fgunnarpeipman%2farchive%2f2010%2f02%2f09%2fvisual-studio-2010-rc-is-available.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.asp.net%2fgunnarpeipman%2farchive%2f2010%2f02%2f09%2fvisual-studio-2010-rc-is-available.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;a rev="vote-for" href="http://servefault.com/Visual-Studio-2010-RC-is-available"&gt;&lt;img alt="Shout it!" src="http://servefault.com/image.axd?url=http%3A%2F%2Fweblogs.asp.net%2Fgunnarpeipman%2Farchive%2F2010%2F02%2F09%2Fvisual-studio-2010-rc-is-available.aspx&amp;countBackColor=00cc00" style="border:0px"/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;a rev="vote-for" href="http://www.9efish.com/Visual-Studio-2010-RC-is-available"&gt;&lt;img alt="顶" src="http://www.9efish.com/image.axd?url=http%3A%2F%2Fweblogs.asp.net%2Fgunnarpeipman%2Farchive%2F2010%2F02%2F09%2Fvisual-studio-2010-rc-is-available.aspx" style="border:0px"/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;a rev="vote-for" href="http://progg.ru/Visual-Studio-2010-RC-is-available"&gt;&lt;img alt="Progg it" src="http://progg.ru/image.axd?url=http%3A%2F%2Fweblogs.asp.net%2Fgunnarpeipman%2Farchive%2F2010%2F02%2F09%2Fvisual-studio-2010-rc-is-available.aspx" style="border:0px"/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="right"&gt;&lt;a rev="vote-for" href="http://dotnetshoutout.com/Visual-Studio-2010-RC-is-available"&gt;&lt;img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fweblogs.asp.net%2Fgunnarpeipman%2Farchive%2F2010%2F02%2F09%2Fvisual-studio-2010-rc-is-available.aspx" style="border:0px"/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7340190" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/gunnarpeipman/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/gunnarpeipman/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/gunnarpeipman/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Visual Studio 2010 RC released for MSDN Subscriber</title><link>http://weblogs.asp.net/vikram/archive/2010/02/09/visual-studio-2010-rc-released-for-msdn-subscriber.aspx</link><pubDate>Tue, 09 Feb 2010 03:46:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7339759</guid><dc:creator>vik20000in</dc:creator><author>vik20000in</author><slash:comments>0</slash:comments><description>&lt;DIV class=PostBody&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Hi,&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Today Microsoft has released Visual Studio 2010 (VS 2010) RC for MSDN Subscriber. It will be available for the General people on RC on 10th February.&lt;BR&gt;&lt;BR&gt;If you are an MSDN subscriber you can go ahead and download the bits right now from the link below.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" mce_href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;The early feedback on Twitter seems very good already about the performance. Do check it out.&lt;BR&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN class=entry-content&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;Support for Silverlight 4 with the VS 2010 RC will show up with next public SL4 drop (and so is not yet enabled with today's bits). Do not upgrade if&amp;nbsp;you are working on Silverlight 4 right now. Wait till the new bits are out.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;BR&gt;Vikram&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7339759" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/vikram/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/vikram/archive/tags/News/default.aspx">News</category><category domain="http://weblogs.asp.net/vikram/archive/tags/visual+studio/default.aspx">visual studio</category></item><item><title>Solution 5 : Implementing Optional Parameters in T-SQL Stored Procedures</title><link>http://weblogs.asp.net/stanleygu/archive/2010/02/08/solution-5-implementing-optional-parameters-in-t-sql-stored-procedures.aspx</link><pubDate>Tue, 09 Feb 2010 02:46:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7339724</guid><dc:creator>StanleyGu</dc:creator><author>StanleyGu</author><slash:comments>4</slash:comments><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;You have a stored procedure GetCustomers with two parameters: LastName, FirstName. The stored procedure returns all the records matching the values of the parameters. You want the parameters be optional, which means skipping the parameter if you do not pass a value.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;T-SQL does not provide optional parameters, but you can implement one.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;You have original stored procedure&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;IMG style="WIDTH: 299px; HEIGHT: 144px" height=144 src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param1.gif" width=299 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param1.gif"&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Add &lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=null&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt; at your parameter declaration of the stored procedure&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;IMG style="WIDTH: 233px; HEIGHT: 40px" height=40 src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param2.gif" width=233 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param2.gif"&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;3.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Add &lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;IS&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: gray"&gt;NULL&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt; at your WHERE clause&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;IMG style="WIDTH: 178px; HEIGHT: 60px" height=60 src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param3.gif" width=178 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param3.gif"&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;4.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Now you have optional parameters in the stored procedure&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;IMG style="WIDTH: 409px; HEIGHT: 147px" height=147 src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param4.gif" width=409 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param4.gif"&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;5.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Call the stored procedure from your data access layer C# code (FirstName is optional)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=ListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param5.gif" mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_Param5.gif"&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7339724" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/stanleygu/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/stanleygu/archive/tags/Solution/default.aspx">Solution</category><category domain="http://weblogs.asp.net/stanleygu/archive/tags/T-SQL/default.aspx">T-SQL</category></item><item><title>Tip 10 : Returning the first part of a string with delimiter</title><link>http://weblogs.asp.net/stanleygu/archive/2010/02/08/tip-10-returning-the-first-part-of-a-string-with-delimiter.aspx</link><pubDate>Tue, 09 Feb 2010 01:45:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7339671</guid><dc:creator>StanleyGu</dc:creator><author>StanleyGu</author><slash:comments>1</slash:comments><description>&lt;P&gt;You have a string delimited by underscore such as 1stPart_2ndPart_3rdPart and want to return the first part of the string only.&lt;/P&gt;
&lt;P&gt;C# Implementation of using Split function:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 420px; HEIGHT: 59px" height=59 src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_1stPart1.gif" width=420 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_1stPart1.gif"&gt;&lt;/P&gt;
&lt;P&gt;T-SQL implementation of using SUBSTRING and CHARINDEX functions:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 616px; HEIGHT: 69px" height=69 src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_1stPart2.gif" width=616 mce_src="http://weblogs.asp.net/blogs/stanleygu/image_20100208_1stPart2.gif"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7339671" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/stanleygu/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/stanleygu/archive/tags/Tip/default.aspx">Tip</category><category domain="http://weblogs.asp.net/stanleygu/archive/tags/T-SQL/default.aspx">T-SQL</category></item><item><title>ASP.NET MVC Complex Object ModelMetaData Issue</title><link>http://weblogs.asp.net/rashid/archive/2010/02/09/asp-net-mvc-complex-object-modelmetadata-issue.aspx</link><pubDate>Mon, 08 Feb 2010 23:06:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7339509</guid><dc:creator>kazimanzurrashid</dc:creator><author>kazimanzurrashid</author><slash:comments>13</slash:comments><description>&lt;p&gt;One of the exciting feature of ASP.NET MVC is(?) auto generating the view of the model with &lt;code&gt;DisplayForModel/EditorForModel&lt;/code&gt; statement, it gives a nice extension point for the application developers to customize the view. But in the latest release (MVC2 RC2), it looks like the feature is no longer available. No, those methods are still available, but they are not working the same way as they were doing in the earlier versions. In rc2, if your model has any complex object, it will not render it . I know some of you like myself thought, one of the major changes in rc2 is the &lt;a title="Input Validation vs. Model Validation in ASP.NET MVC" href="http://bradwilson.typepad.com/blog/2010/01/input-validation-vs-model-validation-in-aspnet-mvc.html"&gt;Input Validation vs. Model Validation in ASP.NET MVC&lt;/a&gt; and rest of it is bug fixing and some improvements. I did check the release note doc, where it is mentioned as     &lt;br /&gt;&lt;/p&gt;  &lt;blockquote&gt;Templated helpers such as Html.EditorFor and Html.DisplayFor show only simple properties by default. &lt;strong&gt;If you need to show complex properties, you can create a custom template to show any set of properties.&lt;/strong&gt; &lt;/blockquote&gt;  &lt;p&gt;Check the last line, it says to show the complex properties we have to create a custom template. But interestingly enough it does not work. Let me show you a very simple example, lets say that we have product and category class like the following:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:50188cac-b2e0-4ced-8528-a3f07b7b157e" class="wlWriterSmartContent"&gt;&lt;pre name="code" class="c#"&gt;public class Category
{
    public int Id { get; set; }

    public string Name { get; set; }
}

public class Product
{
    public int Id { get; set; }

    public string Name { get; set; }

    public decimal Price { get; set; }

    [UIHint("CategoryTemplate")]
    public Category Category { get; set; }
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Check that we are using a custom template (CategoryTemplate) to show the category property.&lt;/p&gt;

&lt;p&gt;And in the Controller:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:b5509d19-778b-4a1d-b8bd-861503870f96" class="wlWriterSmartContent"&gt;&lt;pre name="code" class="c#"&gt;public ActionResult Index()
{
    return View(new Product
                 {
                     Id = 1,
                     Name = "Product 1",
                     Price = 10.0m,
                     Category = new Category { Id = 2, Name = "Category 2" }
                 });
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And in the View we want to render the product:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:706f8462-8bf1-4a18-9ebf-29d81c57562d" class="wlWriterSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage&amp;lt;ComplexObject.Models.Product&amp;gt;" %&amp;gt;
&amp;lt;asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"&amp;gt;
    Home Page
&amp;lt;/asp:Content&amp;gt;
&amp;lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&amp;gt;
    &amp;lt;p&amp;gt;
        &amp;lt;%= Html.DisplayForModel() %&amp;gt;
    &amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;
        To learn more about ASP.NET MVC visit &amp;lt;a href="http://asp.net/mvc" title="ASP.NET MVC Website"&amp;gt;http://asp.net/mvc&amp;lt;/a&amp;gt;.
    &amp;lt;/p&amp;gt;
&amp;lt;/asp:Content&amp;gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;But when the view is rendered, there is no category:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/rashid/CO1_13345C42.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CO1" border="0" alt="CO1" src="http://weblogs.asp.net/blogs/rashid/CO1_thumb_305A044C.png" width="433" height="190" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;I posted this issue in the Gu’s &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/02/05/asp-net-mvc-2-release-candidate-2-now-available.aspx"&gt;RC2 announcement post&lt;/a&gt; as well as in the &lt;a href="http://aspnet.codeplex.com/WorkItem/View.aspx?WorkItemId=5347"&gt;CodePlex&lt;/a&gt;, but the answer that I got is somewhat confusing. I do not think this is a right decision to hide the complex object in the default implementation, I never hard anybody is having some issues with this features and I do not think it is the right time for this change as the MVC2 is in in RC, anyway feature is broken and needs to be resolved in the first place.&lt;/p&gt;

&lt;p&gt;So, till there is a fix, what is the workaround? Lets write some Ha&lt;strike&gt;a&lt;/strike&gt;cky code. First, lets see where the ASP.NET MVC take the decision to show/hide the model property. If you open the &lt;code&gt;DefaultDisplayTemplates.cs&lt;/code&gt; and &lt;code&gt;DefaultEditorTemplates.cs&lt;/code&gt; under the &lt;code&gt;Html&lt;/code&gt; folder of the ASP.NET MVC Source code, you will find both of it has a method called &lt;code&gt;ShouldShow&lt;/code&gt;.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:ee82cc5d-3265-4541-a0a2-d3879b02ff72" class="wlWriterSmartContent"&gt;&lt;pre name="code" class="c#"&gt;private static bool ShouldShow(ModelMetadata metadata, TemplateInfo templateInfo)
{
    return
        metadata.ShowForEdit
        &amp;amp;&amp;amp; metadata.ModelType != typeof (EntityState)
        &amp;amp;&amp;amp; !metadata.IsComplexType
        &amp;amp;&amp;amp; !templateInfo.Visited(metadata);
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The only problematic checking is the &lt;code&gt;IsComplexType&lt;/code&gt; which in turns check whether the type can be converted from the string type :&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:58df209e-ec11-4982-89ba-aa4dafc6b4cc" class="wlWriterSmartContent"&gt;&lt;pre name="code" class="c#"&gt;public virtual bool IsComplexType
{
    get { return !(TypeDescriptor.GetConverter(ModelType).CanConvertFrom(typeof (string))); }
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So the workaround is either we &lt;code&gt;override&lt;/code&gt; the &lt;code&gt;ModelMetadata&lt;/code&gt; which is somewhat an overkill or we can create a &lt;code&gt;TypeConverter&lt;/code&gt; for the complex object for which we have custom template to fool the ASP.NET MVC Framework. In this case it is the &lt;code&gt;Category&lt;/code&gt;. So lets write a converter.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:13dc9ee0-56bc-45f3-8a44-4c5a1d5b7f48" class="wlWriterSmartContent"&gt;&lt;pre name="code" class="c#"&gt;public class CategoryConverter : TypeConverter
{
    public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
    {
        return sourceType == typeof(string) ? true : base.CanConvertFrom(context, sourceType);
    }
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, decorate the Category with this converter:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:dca52752-4aea-473f-8b44-35911f6ef1ad" class="wlWriterSmartContent"&gt;&lt;pre name="code" class="c#"&gt;[TypeConverter(typeof(CategoryConverter))]
public class Category
{
    public int Id { get; set; }

    public string Name { get; set; }
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;when you run the project you will find the category is shown like the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/rashid/CO2_06968959.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CO2" border="0" alt="CO2" src="http://weblogs.asp.net/blogs/rashid/CO2_thumb_0B2C9413.png" width="400" height="218" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And that’s it. You can download the complete code from the following link.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code:&lt;/strong&gt; &lt;a href="http://weblogs.asp.net/blogs/rashid/ComplexObject.zip"&gt;ComplexObject.zip&lt;/a&gt;&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;div class="shoutIt"&gt;&lt;a rev="vote-for" href="http://dotnetshoutout.com/Submit?url=http%3a%2f%2fweblogs.asp.net%2frashid%2farchive%2f2010%2f02%2f09%2fasp-net-mvc-complex-object-modelmetadata-issue.aspx&amp;amp;title=ASP.NET+MVC+Complex+Object+ModelMetaData+Issue"&gt;&lt;img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http://weblogs.asp.net/rashid/archive/2010/02/09/asp-net-mvc-complex-object-modelmetadata-issue.aspx" style="border:0px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7339509" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/rashid/archive/tags/Asp.net/default.aspx">Asp.net</category><category domain="http://weblogs.asp.net/rashid/archive/tags/MVC/default.aspx">MVC</category><category domain="http://weblogs.asp.net/rashid/archive/tags/ASPNETMVC/default.aspx">ASPNETMVC</category><category domain="http://weblogs.asp.net/rashid/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category></item><item><title>IL perversions: throwing and catching strings</title><link>http://weblogs.asp.net/gunnarpeipman/archive/2010/02/09/il-perversions-throwing-and-catching-strings.aspx</link><pubDate>Mon, 08 Feb 2010 22:30:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7339467</guid><dc:creator>DigiMortal</dc:creator><author>DigiMortal</author><slash:comments>3</slash:comments><description>&lt;p&gt;Inspired by Mohamed Mahmoud’s blog posting &lt;a href="http://blogs.msdn.com/mohamedg/archive/2010/02/07/how-to-create-interfaces-with-static-methods-via-il.aspx"&gt;How to: Create Interfaces with Static Methods via IL?&lt;/a&gt; I wrote another sick example on IL (Intermediate Language) to show you how different is the world behind compilers. Tonight I have enough of exceptions, I want to throw some strings! Let’s do it!&lt;/p&gt;  &lt;h3&gt;Throwing exception in IL&lt;/h3&gt;  &lt;p&gt;As a first thing take a look at the following code written in IL. In short this code defines class with two methods. Run() is entry point and it is run automatically when compiled assembly is executed from command line. ThrowSomething() is method that throws exception. This exception is caught and program terminates without any errors. I borrowed this code from &lt;a href="http://www.vijaymukhi.com/documents/books/ilbook/ilbook.html"&gt;Vijay Mukhi’s IL book&lt;/a&gt;, &lt;a href="http://www.vijaymukhi.com/documents/books/ilbook/chap10.htm"&gt;Chapter 10 “Exception Handling”&lt;/a&gt;.&lt;/p&gt;  &lt;hr size="1" /&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;.assembly StringMess {}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;.&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: blue"&gt;private&lt;/span&gt; auto ansi Program extends [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Object&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; .method &lt;span style="color: blue"&gt;public&lt;/span&gt; hidebysig &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Run() il managed&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .entrypoint&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .locals (&lt;span style="color: blue"&gt;class&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Exception V_0)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .&lt;span style="color: blue"&gt;try&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; Program::ThrowSomething()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ldstr&amp;#160;&amp;#160; &lt;span style="color: #a31515"&gt;&amp;quot;Bye&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Console::WriteLine       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.String)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; leave.s IL_001e&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;catch&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Exception&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stloc.0&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ldstr&amp;#160;&amp;#160; &lt;span style="color: #a31515"&gt;&amp;quot;Exception was thrown!&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Console::WriteLine       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.String)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; leave.s IL_001e&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IL_001e: ldstr &lt;span style="color: #a31515"&gt;&amp;quot;Finish&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Console::WriteLine       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.String)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ret&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; .method &lt;span style="color: blue"&gt;public&lt;/span&gt; hidebysig &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ThrowSomething()       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; il managed&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; newobj instance &lt;span style="color: blue"&gt;void&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Exception::.ctor()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;throw&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;hr size="1" /&gt; &lt;/div&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 3px 0px 0px 10px; display: inline; border-top: 0px; border-right: 0px" title="IL: Exception got caught" border="0" alt="IL: Exception got caught" align="right" src="http://weblogs.asp.net/blogs/gunnarpeipman/ilthrowstringex_05CB33D8.png" width="178" height="72" /&gt;Everybody who is familiar with C# should be able to understand this code at least in some parts. Now let’s see what is the output of this method. As image on right shows it is nothing special. We threw exception, it was handled and program terminated normally. Just like we expected.&lt;/p&gt;  &lt;h3&gt;Let’s throw some strings now&lt;/h3&gt;  &lt;p&gt;Now let’s modify this code so it should do something we expect to end up with error. I add one more catch clause. This additional catch catches &lt;a href="http://msdn.microsoft.com/en-us/library/system.string.aspx"&gt;String&lt;/a&gt;. To test it I will do exactly what this catch expects – I will throw out the String. Here is the code.&lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;hr size="1" /&gt;     &lt;p style="margin: 0px"&gt;.assembly StringMess {}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;.&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: blue"&gt;private&lt;/span&gt; auto ansi Program extends [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Object&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; .method &lt;span style="color: blue"&gt;public&lt;/span&gt; hidebysig &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Run() il managed&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .entrypoint&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .locals (&lt;span style="color: blue"&gt;class&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Exception V_0)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .&lt;span style="color: blue"&gt;try&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; Program::ThrowSomething()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ldstr&amp;#160;&amp;#160; &lt;span style="color: #a31515"&gt;&amp;quot;Bye&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Console::WriteLine      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.String)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; leave.s IL_001e&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;catch&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Exception&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stloc.0&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ldstr&amp;#160;&amp;#160; &lt;span style="color: #a31515"&gt;&amp;quot;Exception was thrown!&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Console::WriteLine      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.String)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; leave.s IL_001e&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// CATCH STRING&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;//&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;catch&lt;/span&gt; System.String&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stloc.0&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ldstr&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #a31515"&gt;&amp;quot;String was thrown&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Console::WriteLine      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.String)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; leave.s IL_001e&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IL_001e: ldstr &lt;span style="color: #a31515"&gt;&amp;quot;Finish&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; call&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.Console::WriteLine      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.String)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ret&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; .method &lt;span style="color: blue"&gt;public&lt;/span&gt; hidebysig &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ThrowSomething()       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; il managed&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;//newobj instance void [mscorlib]System.Exception::.ctor()&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;//&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// THROW STRING&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;//&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ldsfld&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; [mscorlib]&lt;span style="color: #2b91af"&gt;System&lt;/span&gt;.String::Empty&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;throw&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;hr size="1" /&gt; &lt;/div&gt;  &lt;p&gt;We can expect that this code doesn’t compile, but it does. As a next thing we may expect that running this code some runtime error occurs, but no, there is no runtime error. We can expect that exception handling lands in catch for Exception… we can expect many things but the result is here.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 3px 0px 0px 10px; display: inline; border-top: 0px; border-right: 0px" title="IL: catch string works!" border="0" alt="IL: catch string works!" align="right" src="http://weblogs.asp.net/blogs/gunnarpeipman/ilthrowstring_4DC93FF4.png" width="148" height="67" /&gt; I bet at least half of readers expected something else but yes, we just threw string and we also caught it. But why C# and VB.NET give us errors when we try to compile code like this? Well, it is a compiler level limitation. It is not related to CLR as we just saw.&lt;/p&gt;  &lt;h3&gt;Playing with Visual Studio&lt;/h3&gt;  &lt;p&gt;Let’s play now with &lt;a href="http://weblogs.asp.net/gunnarpeipman/archive/tags/Visual+Studio/default.aspx"&gt;Visual Studio&lt;/a&gt;. I created console application, compiled previous example as DLL and referenced it from my console application. I want to know what happens when string is thrown and caught. Does it affect compiler somehow?&lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;hr size="1" /&gt;     &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; ConsoleExamples&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Program&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; StringMess.&lt;span style="color: #2b91af"&gt;Program&lt;/span&gt;.Run();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ReadLine();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ReadLine(); &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;hr size="1" /&gt; &lt;/div&gt;  &lt;p&gt;Well, it does not. Let’s try to call ThrowSomething() method now. Maybe something interesting happens. &lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;hr size="1" /&gt;     &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; ConsoleExamples&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Program&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; StringMess.&lt;span style="color: #2b91af"&gt;Program&lt;/span&gt;.ThrowSomething();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ReadLine();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;hr size="1" /&gt; &lt;/div&gt;  &lt;p&gt;Okay, now something happens. Our application is not able to handle the situation and it throws &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.runtimewrappedexception.aspx"&gt;RuntimeWrappedException&lt;/a&gt;.&lt;/p&gt;  &lt;p align="center"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RuntimeWrapperException" border="0" alt="RuntimeWrapperException" src="http://weblogs.asp.net/blogs/gunnarpeipman/runtimewrappedexception_7A05C6D8.png" width="452" height="252" /&gt; &lt;/p&gt;  &lt;p&gt;RuntimeWrappedException is located under &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.aspx"&gt;System.Runtime.CompilerServices&lt;/a&gt; namespace and as documentation sais it is here &lt;em&gt;to maintain compatibility between languages. The common language runtime (CLR) wraps objects that do not derive from &lt;a href="http://msdn.microsoft.com/en-us/library/system.exception.aspx"&gt;Exception&lt;/a&gt; in a RuntimeWrappedException object&lt;/em&gt;. This is why we got exception and not completely crashed application.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;TIP!&lt;/strong&gt; If you want to find out more about IL there is very good book I can suggest: &lt;a href="http://weblogs.asp.net/gunnarpeipman/archive/2008/11/06/expert-net-2-0-il-assembler.aspx"&gt;Expert .NET 2.0 IL Assembler&lt;/a&gt; by Serge Lidin. I have read this book and also the idea of this posting is taken from this book. If you are interested in my other postings about IL and compiling results then please take a look at &lt;a href="http://weblogs.asp.net/gunnarpeipman/archive/tags/Behind+the+Compiler/default.aspx"&gt;Behind the Compiler&lt;/a&gt; category.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Okay, it’s couple of minutes over midnight here and it is time to throw some real strings, I guess. Good night!&lt;/p&gt;

&lt;hr size="1" /&gt;

&lt;table border="0" cellpadding="0" cellspacing="2" width="100%"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.asp.net%2fgunnarpeipman%2farchive%2f2010%2f02%2f09%2fil-perversions-throwing-and-catching-strings.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.asp.net%2fgunnarpeipman%2farchive%2f2010%2f02%2f09%2fil-perversions-throwing-and-catching-strings.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;a rev="vote-for" href="http://servefault.com/IL-perversions-throwing-and-catching-strings"&gt;&lt;img alt="Shout it!" src="http://servefault.com/image.axd?url=http%3A%2F%2Fweblogs.asp.net%2Fgunnarpeipman%2Farchive%2F2010%2F02%2F09%2Fil-perversions-throwing-and-catching-strings.aspx&amp;countBackColor=00cc00" style="border:0px"/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;a rev="vote-for" href="http://www.9efish.com/IL-perversions-throwing-and-catching-strings"&gt;&lt;img alt="顶" src="http://www.9efish.com/image.axd?url=http%3A%2F%2Fweblogs.asp.net%2Fgunnarpeipman%2Farchive%2F2010%2F02%2F09%2Fil-perversions-throwing-and-catching-strings.aspx" style="border:0px"/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="center"&gt;&lt;a rev="vote-for" href="http://progg.ru/IL-perversions-throwing-and-catching-strings"&gt;&lt;img alt="Progg it" src="http://progg.ru/image.axd?url=http%3A%2F%2Fweblogs.asp.net%2Fgunnarpeipman%2Farchive%2F2010%2F02%2F09%2Fil-perversions-throwing-and-catching-strings.aspx" style="border:0px"/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="right"&gt;&lt;a rev="vote-for" href="http://dotnetshoutout.com/IL-perversions-throwing-and-catching-strings"&gt;&lt;img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fweblogs.asp.net%2Fgunnarpeipman%2Farchive%2F2010%2F02%2F09%2Fil-perversions-throwing-and-catching-strings.aspx" style="border:0px"/&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7339467" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/gunnarpeipman/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/gunnarpeipman/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/gunnarpeipman/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/gunnarpeipman/archive/tags/Behind+the+Compiler/default.aspx">Behind the Compiler</category><category domain="http://weblogs.asp.net/gunnarpeipman/archive/tags/Exceptions/default.aspx">Exceptions</category></item></channel></rss>