Title: Changed hosting + IIS 7.0 breaking changes
Slug: changed-hosting-iis-7-0-breaking-changes
Date: 2011-02-04 00:04:05
Author: Kartones
Lang: en
Tags: Development, Systems-IT, Kartones.Net, ASP.NET, Windows
Description: Migrating Kartones.net to a new hosting company and encountering issues due to Microsoft's IIS 7.0 breaking changes.

 <p>This last monday I migrated Kartones.net from the previous hosting company to a much better one (a link to it it's on the footer of all blogs in the community), which is also Spanish so for once I'm going more "national" instead of going for USA-based hosting providers. As usually happens, cheap is paid in other ways (lack of support, stagnant framework versions...) so I decided to invest more money and so far I've had a great technical support :)</p> <p>I had some problems regarding the migration, but mostly were due to Microsoft's commitment of making every developer's life harder from time to time by introducing breaking changes.</p> <p>They can be summarized in two groups:</p> <ol> <li>Some changes related to <a href="http://learn.iis.net/page.aspx/381/aspnet-20-breaking-changes-on-iis-70/">how IIS 7 behaves itself</a>. In my case, the removal of <font face="Courier New">&lt;httpHandlers&gt;</font> and <font face="Courier New">&lt;httpModules&gt;</font> for <font face="Courier New">&lt;handlers&gt;</font> and <font face="Courier New">&lt;modules&gt;</font>. </li> <li><a href="http://mvolo.com/blogs/serverside/archive/2007/11/10/Integrated-mode-Request-is-not-available-in-this-context-in-Application_5F00_Start.aspx">HttpContext.Current.Request not available in the IIS 7 Integrated mode</a>. This one was even better. For 9 years we've been able to use that object in the <font face="Courier New">Application_Start</font> method of the Global.asax file, but now you can't due to a design change (if you're on a vhost like me, there is a Classic Mode but for IIS admins).</li></ol> <p>Basically the workaround for the second point consists on either removing calls to context (impossible in the case of Community Server 2007 due to it's architecture) or build a class to perform a lock and set a flag to true to detect that initial application starting call.</p> <p>It is not that I don't see as good the benefits of the <a href="http://learn.iis.net/page.aspx/244/how-to-take-advantage-of-the-iis7-integrated-pipeline/">Integrated Pipeline</a>, but the compatibility mode should be available at web.config level to avoid problems in vhosts, instead of forcing to change your code (if I didn't had the source code, I would have been in real trouble!).</p> <p> </p> <p>Anyway, if you plan to publish a website done in ASP.NET 2.0 to 3.5 (which internally means "just ASP.NET 2.0"), make sure you check all the breaking stuff and fix it.</p>
