Wednesday, May 23, 2007

ASP.NET Web Apps - Migrating from 1.1 to 2.0

I've spent an afternoon trying to deploy a web application that I've had in ASP.NET v1.1 on a production server to ASP.NET 2.0. The problem has been that after I deployed the application using the method that I had for 1.1 I got an error similar to this:

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'Namespace.Global'.

Source Error:
Line 1:  <%@ Application Codebehind="Global.asax.cs" Inherits="Namespace.Global" %>

Source File: /cs/global.asax Line: 1



Now, this was driving me nuts. But thankfully I found the reason in this blog - I thought I'd make note of it and explain it again, so that search engines will be able to find this better. Basically it boils down to this: in ASP.NET 2.0, when using VS2005, you must publish the site. Essentially this compiles everything into a neat package that you can save somewhere to upload it later or transfer directly using FTP.

To publish the site, in the Solution explorer in Visual Studio, right click on the Project and select "Publish...". I did this, saved it to my development machine, uploaded to a production server (albeit a sandbox area) and configured IIS.

No comments: