Wednesday, June 01, 2005

Teaching at BMW running into Bugs

The other day I held a ASP.NET seminar at the Munich FIZ (Research and Innovation Center) of BMW. One of the first things I told them to do was to rename the WebForm1.aspx to Default.aspx, as the IIS will search, by default, for a Default.aspx file in the directory requested by the client.

Well, as life goes, once we were ready to compile and test the application for the first time, some of the participants got the following ASP.NET error:

Compiler error message: CS1031: Type expected

line 28: [System.Runtime.CompilerServices. CompilerGlobalScopeAttribute()]
line 29: public class default_aspx : default.TWebForm1, System.Web.SessionState.IRequiresSessionState {

After looking for some time it dawned at me. All that had the problem had renamed their web form to default.aspx, note that smaller case "d" there. The automatically generated class name now read default.TWebForm1. default is a reserved keyword in C#, which is the language of Delphi ASPX files.

After all, one has to watch when renaming files that you don't run into reserved C# words...
Search WWW Search