<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'app:weblogs' matching tag '.NET4.5'</title><link>http://msmvps.com/search/SearchResults.aspx?q=app:weblogs&amp;tag=.NET4.5&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tag '.NET4.5'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Breaking Changes In Argument List Evaluation In C# 5.0</title><link>http://msmvps.com/blogs/paulomorgado/archive/2012/07/18/breaking-changes-in-argument-list-evaluation-in-c-5-0.aspx</link><pubDate>Wed, 18 Jul 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1812975</guid><dc:creator>paulo</dc:creator><description>&lt;p&gt;The &lt;a title="C# Language Specification" href="http://msdn.microsoft.com/library/ms228593.aspx" target="_blank"&gt;C# Language Specification&lt;/a&gt; states on §7.5.1.2 that “(…) the expressions or variable references of an argument list are evaluated in order, from left to right (…)”.&lt;/p&gt;  &lt;p&gt;So, when this code is compiled with the &lt;a title="Microsoft Visual C#" href="http://csharp.net/" target="_blank"&gt;C#&lt;/a&gt; 4.0 compiler:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;static void &lt;/span&gt;M(
    &lt;span style="color:blue;"&gt;int &lt;/span&gt;x = 10,
    &lt;span style="color:blue;"&gt;int &lt;/span&gt;y = 20,
    &lt;span style="color:blue;"&gt;int &lt;/span&gt;z = 30)
{
    &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(
        &lt;span style="color:#a31515;"&gt;&amp;quot;x={0}, y={1}, z={2}&amp;quot;&lt;/span&gt;, x, y, z);
}

&lt;span style="color:blue;"&gt;static void &lt;/span&gt;Main(&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] args)
{
    &lt;span style="color:blue;"&gt;int &lt;/span&gt;a = 0;

    M(++a, z: ++a);
}&lt;/pre&gt;

&lt;p align="justify"&gt;and run, this unexpected output is obtained:&lt;/p&gt;

&lt;pre class="code"&gt;x=2, y=20, z=1&lt;/pre&gt;

&lt;p align="justify"&gt;In fact, fixing this compiler flaw was the cause of one of the few &lt;a title="Visual C# Breaking Changes in Visual Studio 2012" href="http://msdn.microsoft.com/library/hh678682(v=vs.110).aspx" target="_blank"&gt;breaking changes introduced in C# 5.0&lt;/a&gt;.&lt;/p&gt;

&lt;p align="justify"&gt;Using the 5.0 compiler, the expected result is obtained:&lt;/p&gt;

&lt;pre class="code"&gt;x=1, y=20, z=2&lt;/pre&gt;

&lt;p align="justify"&gt;To avoid this type of surprises, expression evaluation should be avoided in argument lists.&lt;/p&gt;

&lt;p align="justify"&gt;With this code:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;int &lt;/span&gt;a = 0;

&lt;span style="color:blue;"&gt;int &lt;/span&gt;i = ++a;
&lt;span style="color:blue;"&gt;int &lt;/span&gt;j = ++a;

M(i, z: j);&lt;/pre&gt;

&lt;p align="justify"&gt;the same result is obtained for both C# 4.0 and C# 5.0:&lt;/p&gt;

&lt;pre class="code"&gt;x=1, y=20, z=2&lt;/pre&gt;</description></item><item><title>What Is The .NET Framework 4.5?</title><link>http://msmvps.com/blogs/paulomorgado/archive/2011/10/17/what-is-the-net-framework-4-5.aspx</link><pubDate>Mon, 17 Oct 2011 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1801302</guid><dc:creator>paulo</dc:creator><description>&lt;p align="justify"&gt;According to the &lt;a title=".NET Blog" href="http://blogs.msdn.com/b/dotnet/" target="_blank"&gt;.NET Blog&lt;/a&gt;, &lt;strong&gt;.NET Framework 4.5&lt;/strong&gt; is an in-place update that replaces &lt;strong&gt;.NET Framework 4.0&lt;/strong&gt; (rather than a side-by-side installation). The goal is for &lt;strong&gt;.NET 4.5&lt;/strong&gt; to be fully &lt;a href="http://en.wikipedia.org/wiki/Backward_compatibility"&gt;backward compatible&lt;/a&gt; with applications built for &lt;strong&gt;.NET 4.0&lt;/strong&gt; (.NET 3.5 and .NET 4.5 will be side-by-side).&lt;/p&gt;  &lt;p align="justify"&gt;One of the first things you’ll notice about &lt;strong&gt;.NET 4.5&lt;/strong&gt; is the version number of the &lt;a title="Common Language Runtime (CLR)" href="http://msdn.microsoft.com/library/8bs2ecf4.aspx" target="_blank"&gt;CLR&lt;/a&gt; (4.0.30319) is the same as &lt;strong&gt;.NET 4.0&lt;/strong&gt;; this is the practice used by other in-place updates. (&lt;a title="Compatibility of .NET Framework 4.5" href="http://blogs.msdn.com/b/dotnet/archive/2011/09/26/compatibility-of-net-framework-4-5.aspx" target="_blank"&gt;read more&lt;/a&gt;)&lt;/p&gt;  &lt;p align="justify"&gt;In fact, if you compare a system with &lt;strong&gt;.NET 4.5&lt;/strong&gt; with a system with .NET 4.0 you’ll see that 4.5 is just an update to 4.0:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2"&gt;&lt;thead&gt;     &lt;tr&gt;       &lt;th valign="top" colspan="3"&gt;Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full&lt;/th&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;th valign="top"&gt;Value&lt;/th&gt;        &lt;th valign="top"&gt;.NET 4.0 &lt;/th&gt;        &lt;th valign="top"&gt;.NET 4.5 &lt;/th&gt;     &lt;/tr&gt;   &lt;/thead&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;Version&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;4.0.30319&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;4.5.40805&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;CBS&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;1&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;1&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;TargetVersion&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;4.0.0&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;4.0.0&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Install&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;1&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;1&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Servicing&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;0&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;0&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Release&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;&amp;#160;&lt;/td&gt;        &lt;td style="text-align:right;" valign="top"&gt;368485&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;InstallPath&lt;/td&gt;        &lt;td style="text-align:left;" valign="top"&gt;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\&lt;/td&gt;        &lt;td style="text-align:left;" valign="top"&gt;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p align="justify"&gt;One of the major additions to the framework is the support for the &lt;a title="Task-based Asynchronous Pattern" href="http://www.microsoft.com/download/en/details.aspx?id=19957" target="_blank"&gt;Task-based Asynchronous Pattern&lt;/a&gt;. All classes with asynchronous APIs have be augmented with a Task-based asynchronous API.&lt;/p&gt;  &lt;p align="justify"&gt;Task exception handling has also changed in .NET 4.5 to accommodate the new &lt;strong&gt;async&lt;/strong&gt; keywords in &lt;a title="Microsoft Visual C#" href="http://csharp.net/" target="_blank"&gt;C#&lt;/a&gt; and VB. (&lt;a title="Task Exception Handling in .NET 4.5" href="http://blogs.msdn.com/b/pfxteam/archive/2011/09/28/10217876.aspx" target="_blank"&gt;read more&lt;/a&gt;)&lt;/p&gt;</description></item></channel></rss>