Known Issues / Breaking Changes for ASP.NET in .NET 3.5 Service Pack 1http://forums.asp.net/t/1305800.aspx/1?Known+Issues+Breaking+Changes+for+ASP+NET+in+NET+3+5+Service+Pack+1Fri, 15 Aug 2008 00:27:54 -040013058002559476http://forums.asp.net/p/1305800/2559476.aspx/1?Known+Issues+Breaking+Changes+for+ASP+NET+in+NET+3+5+Service+Pack+1Known Issues / Breaking Changes for ASP.NET in .NET 3.5 Service Pack 1 <p>With the release of ASP.NET in .NET 3.5 Service Pack 1 some breaking changes have been introduced. This post will be used to list those changes and any workarounds / fixes for these issues.</p> <p></p> <p><strong></strong></p> <span style="font-family:'Calibri','sans-serif'"><strong><font size="3">Issue:&nbsp; The HtmlForm action attribute is now honored when defined in declarative markup.</font></strong></span><font size="3" face="Calibri">&nbsp; <br> <br> </font><font size="3"><strong><span style="font-family:'Calibri','sans-serif'">Reason:</span><br> </strong><font face="Calibri">3.5 SP1 added a settable Action property to the HtmlForm type.&nbsp; This new feature makes it much easier for developers to explicitly set the forms action attribute for scenarios where a developer wants to use a different Url than the normal postback-generated Url.&nbsp; However this change also means that if the action attribute has been set in an .aspx pages declarative markup, ASP.NET will use the setting from the markup when rendering a &lt;form /&gt; element.&nbsp;&nbsp; </font></font><strong><font size="3"><font face="Calibri">Symptom:</font></font></strong> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3" face="Calibri">If the form action attribute was set to a page other than the page itself, for example, the action attribute was set to test.aspx on default.aspx, exception below will be thrown.&nbsp; </font></p> <font size="3" face="Calibri">&nbsp;</font> <p class="MsoNormal" style="margin:0in 0in 0pt"><i><span style="font-family:'Verdana','sans-serif'; color:maroon; font-size:14pt">Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that &lt;machineKey&gt; configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.</span></i><span style="font-family:'Verdana','sans-serif'; color:maroon; font-size:14pt"> </span></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><span><br> <strong><font size="3">Workaround I:</font></strong></span><br> <font size="3" face="Calibri">Previous versions of ASP.NET always ignored the action attribute if it was present in the declarative markup for a &lt;form /&gt; element.&nbsp; Developers should remove the action attribute from their declarative markup to return to the original behavior where ASP.NET renders the postback Url.&nbsp;<br> <br> </font><strong><font size="3"><span style="font-family:'Calibri','sans-serif'">Example:</span><br> </font></strong><font size="3" face="Calibri">Before (the action attribute was ignored by ASP.NET as dead code):&nbsp; &lt;form name=&quot;form1&quot; method=&quot;post&quot; runat=&quot;server&quot; action=&quot;test.aspx&quot;&gt;&lt;/form&gt; <br> 3.5 SP1 (remove the action attribute to have ASP.NET render the postback Url):&nbsp; &lt;form name=&quot;form1&quot; method=&quot;post&quot; runat=&quot;server&quot; &gt;&lt;/form&gt;&nbsp;</font></p> <font size="3" face="Calibri">&nbsp;</font><font size="3"><strong><span style="font-family:'Calibri','sans-serif'">Workaround II:</span><br> </strong><font face="Calibri">Instead of removing action attribute of each page on the web site, developers could also add the following code into global.asax.</font></font><span style="font-family:'Courier New'; background:yellow; font-size:10pt">&lt;%</span><span style="font-family:'Courier New'; color:blue; font-size:10pt">@</span><span style="font-family:'Courier New'; font-size:10pt"> <span style="color:#a31515">Application</span> <span style="color:red">Language</span><span style="color:blue">=&quot;C#&quot;</span> <span style="background:yellow">%&gt;</span></span><span style="font-family:'Courier New'; color:blue; font-size:10pt">&lt;</span><span style="font-family:'Courier New'; color:#a31515; font-size:10pt">script</span><span style="font-family:'Courier New'; font-size:10pt"> <span style="color:red">runat</span><span style="color:blue">=&quot;server&quot;&gt;</span></span><span style="font-family:'Courier New'; color:blue; font-size:10pt">void</span><span style="font-family:'Courier New'; font-size:10pt"> Application_PreRequestHandlerExecute() {</span><span style="font-family:'Courier New'; font-size:10pt">&nbsp;&nbsp;&nbsp; <span style="color:blue"> var</span> page = Context.Handler <span style="color:blue">as</span> <span style="color:#2b91af"> Page</span>;</span><span style="font-family:'Courier New'; font-size:10pt">&nbsp;&nbsp;&nbsp; <span style="color:blue"> if</span> (page != <span style="color:blue">null</span>) page.Init &#43;= <span style="color:blue"> delegate</span> {</span><span style="font-family:'Courier New'; font-size:10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue">if</span> (page.Form != <span style="color:blue">null</span> &amp;&amp; !<span style="color:blue">string</span>.IsNullOrEmpty(page.Form.Action)) {</span><span style="font-family:'Courier New'; font-size:10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; page.Form.Action = <span style="color:blue">string</span>.Empty;</span><span style="font-family:'Courier New'; font-size:10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><span style="font-family:'Courier New'; font-size:10pt">&nbsp;&nbsp;&nbsp; };</span><span style="font-family:'Courier New'; font-size:10pt">}</span><span style="font-family:'Courier New'; color:blue; font-size:10pt">&lt;/</span><span style="font-family:'Courier New'; color:#a31515; font-size:10pt">script</span><span style="font-family:'Courier New'; color:blue; font-size:10pt">&gt;</span><span style="color:#1f497d"></span> <p><strong>Issue: &nbsp;Dynamic Data fails on Entity Framework data models that contain 1-&gt;0..1 and *-&gt;1 database relations<br> <br> Reason:</strong><br> Dynamic Data fails on Entity Framework data models that contain 1-&gt;0..1 and *-&gt;1 database relations with an error like &quot;'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Orders.OrderID'&quot;. These types of relationships occur in many databases including Northwind and AdventureWorks. The error is caused by a naming mismatch that Dynamic Data has with the wrapper objects being returned by the EntityDataSource.<br> <br> <strong>Workaround:<br> </strong>We have a temporary fix available at: <a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16367"> http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=16367</a> which replaces the data model provider with one that names the properties correctly.</p> <p><strong>Issue: After installing .NET 3.5 SP1, a web site using a derived version of the UpdateProgress control may encounter the following exception: A ProgressTemplate must be specified on UpdateProgress control with ID id.</strong>&nbsp; </p> <p><strong>Reason:</strong><br> &nbsp;In the .NET Framework 3.5, the UpdateProgress control enforced the requirement of a ProgressTemplate from its PreRender routine. A derived UpdateProgress control could subvert that requirement by overriding OnPreRender in the derived control, and avoiding calling base.OnPreRender. In the .NET Framework 3.5 SP1, the UpdateProgress control now uses CreateChildControls to instantiate the ProgressTemplate, causing the requirement to be enforced at a different point in the page life cycle, and preventing the OnPreRender technique from subverting the check. </p> <p><strong>Issue: Hidden files/folders inside App_Browsers are not ignored<br> <br> Reason:<br> </strong>3.5SP1 does not honor the fact that _vti_cnf is Hidden and it still tries to read it and parse the file inside that folder.. which results in this error.</p> <p><strong>Workaround:</strong><br> At the moment the workaround is to simply delete _vti_cnf folder however we are still investigating a fix for this issue.<br> </p> <span lang="EN-US" style=""><font size="3" face="Calibri"><br> </font></span><span lang="EN-US" style=""><font face="Calibri"> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3"><span style="font-family:'Calibri','sans-serif'"><strong>Issue: After installing .NET 3.5 SP1, a web site using pageBaseType now encounters the following compilation error: Make sure that the class defined in this code file matches the 'inherits' attribute.</strong></span>&nbsp;<br> <br> </font><font size="3"><strong><span style="font-family:'Calibri','sans-serif'">Reason:</span><br> </strong>The behavior you are seeing is the original behavior of ASP.NET 2.0. When the .NET Framework 3.5 and Visual Studio 2008 were introduced, a bug was introduced that affected certain pageBaseType scenarios that unfortunately were not intended. It seems as if you might have run into one of these scenarios. In the .NET Framework 3.5 SP1, the bug was fixed and these scenarios no longer occur; pageBaseType again works the same as in ASP.NET 2.0, as requested by customers. Unfortunately, this means that customers who have relied on the unintended behavior that was introduced in the .NET Framework 3.5 will now encounter problems when they run their applications.</font></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3"></font>&nbsp;</p> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3">We are now evaluating creating a HotFix for these scenarios and providing workarounds for customers to help with this issue.&nbsp; </font></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><br> <font size="3">Here are some details about the issue; we&nbsp; will post a more detailed description soon. The mismatch is caused by the class in the code file not being assignable to the pageBaseType that is defined in the web.config file. The sequence that occurs is this:</font></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3"></font>&nbsp;</p> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3">- During code generation for a page (MyPage.aspx) in a Web site, ASP.NET creates a separate class from the class that is defined in the code-behind file source (MyPage.aspx.cs). The web.config files pageBaseType value can be used in cases where you want all pages to have certain properties. It applies to all pages, not just to pages that do not have code-behind files.</font></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3">- If MyPage.aspx has a CodeFile attribute and therefore inherits from a class that is defined in MyPage.aspx.cs, the class defined in MyPage.aspx.cs must extend the pageBaseType class. </font></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><br> <br> <font size="3"><strong><span style="font-family:'Calibri','sans-serif'">Workarounds:</span><br> </strong>1. If the pageBaseType class (for example, MyBasePage) is not needed for all pages, you can remove it from the web.config file, or;</font></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3">2. Where pages do require the pageBaseType value, modify the classes in the code-behind files to extend the base type. In the filename.aspx.cs code-behind file, make sure that the class inherits from the pageBaseType that is specified in the web.config file (for example, public partial class CodeFileClass : MyBasePage instead of public partial class CodeFileClass : System.Web.UI.Page).</font></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3">3. An alternative workaround will allow you to add the following attribute to your page directive: </font></p> <p class="MsoNormal" style="margin:0in 0in 0pt"><font size="3">CodeFileBaseClass=&quot;System.Web.UI.Page&quot;</font></p> </font></span> <p>&nbsp;</p> 2008-08-15T00:27:54-04:00