views:

112

answers:

2

I have to inherit some legacy code in company, which is written in Visual Basic.NET 7.0 (Visual Studio.NET 2002). I don't have much experiences in VB.NET, and this line of code gets me in trouble:

Public Class Global : Inherits System.Web.HttpApplication

Visual Studio gave this error: Error 31 Keyword is not valid as an identifier. C:\Documents and Settings\Administrator\Desktop\POMan\WebApplication1\Global.asax.vb 4 14 C:...\POMan\

How can I fix this?

A: 

Change the name Global to be something more descriptive, so that it doesn't clash.

Mitch Wheat
+3  A: 

If you really really want to call it Global, then use [Global], although I would recommend changing the name instead.

If you continue to call it Global, then be aware also that any reference to the class will need to be prefixed with the namespace.

Patrick McDonald