Delta Engine Blog

All about multiplatform and game development

Migrating ASP.NET VS2005 Beta to VS2005 RC/final

Well, I installed the new .NET 2.0 Framework of VS2005 RC on my server and most of my web apps and services stopped working. This site was also down for a couple of hours because I had a problem with MSDE (which had to be reinstalled as well and caused trouble).


Parser Error Message: Error parsing attribute 'compilewith': Type 'System.Web.UI.Page' does not have a public property named 'compilewith'.

The first thing to check after uninstalling the old .NET 2.0 Beta Framework and installing the new .NET 2.0 RC (or final, I guess there won't be much difference) is to restore all aspnet appslications back to .NET 2.0 (they will link to .NET 1.1 after uninstalling .NET 2.0 Beta).

You can do this with the command "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis /i" (this will install .NET 2.0 for all ASP.NET apps, if you just want to use .NET for certain apps use /? to learn more about the allowed arguments). Alternatively you can use the ASP.NET Version Switcher (dunno if this works perfectly, but the tool looks cool).

The next problem might be that .NET 2.0 changed quite a bit. You might have to change some .aspx files from

  • <%@ Page Language="C#" CompileWith="Default.aspx.cs" ClassName="Default_aspx" %>

  • to
  • <%@ Page Language="C#" CodeFile="Default.aspx.cs" Inherits="Default_aspx" %>

  • and modify the code behind classes to derive from Page or UserControl:
  • public partial class Default_aspx : Page
    { [...]
  • WebServices can still use CodeBehind and Class, but because of a strange "Could not create type ..." Error I had to recompile them and found out that you have to change the class attribute a little:

  • [WebServiceBinding(ConformanceClaims = WsiClaims.None, EmitConformanceClaims = true)]

  • to
  • [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

  • That's it, your websites should run the way they are supposed to again. If not, ask google for more help ^^