Updating from early ASP.NET Beta builds to Beta 2
If you're upgrading some mid-BETA or CTP ASP.NET 2.0 code and you get some cryptic messages like
- c:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Temporary ASP.NET Files\chapter 10 - 8 - csharp\3e344bac\60be3ec8\-sngkrtn.0.cs(265): error CS0115: 'ASP._Default_aspx.FrameworkInitialize()': no suitable method found to override
- 'ASP._Default_aspx.FrameworkInitialize()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Temporary ASP.NET Files\chapter 10 - 8 - csharp\3e344bac\60be3ec8\-sngkrtn.0.cs 265
- 'ASP._Default_aspx.GetTypeHashCode()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Temporary ASP.NET Files\chapter 10 - 8 - csharp\3e344bac\60be3ec8\-sngkrtn.0.cs 272
You'll need to make a few changes. First, you probably already updated your ASPX Markup.
In your ASPX page:
OLD: <%@ Page Language="C#" CompileWith="Default.aspx.cs" ClassName="Default_aspx" %>
NEW: <%@ Page Language="C#" codefile="Default.aspx.cs" Inherits="Default_aspx" %>
In your ASPX.CS source file:
OLD: public partial class Default_aspx
NEW: public partial class Default_aspx : Page
No free derivation any more, you have to explictly derive from a class that ulitmately derives from System.Web.UI.Page. It is that derivation that will get ride of the override compiler errors seen above. This who post also applies to pages written in VB.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Thanks Scott - still wrestling but at least I've a pointer to the right direction :-)
Comments are closed.