Global.asax.vb code not executing

I used the migration wizard to upgrade my projects to 2005. It did not bring in my global.asax or global.asax.vb files. Instead it created a new global.asax file without any codebehind it. So I dragged and dropped my global.asax.vb file into the project. It complained about this...

Public

Class Global

because "Global" is a reserved word. So I changed it to ERSWeb which is the name of the project. It compiles fine but seems to completely ignore the code in the global.asax.vb file. I'm a little confused about the code in the Global.asax file...

<%

@ Application Codebehind="Global.asax.vb" Inherits="ERSWeb.Global" %>

I've tried changing the Inherits to "ERSWeb.ERSWeb" since that is what I changed the class to but it didn't work - it won't hit my breakpoints in the Global.asax.vb file.

I would really appreciate any help with this problem.

Thanks!

0
ferrethouse
4/11/2006 10:39:48 PM
📁 asp.net.migrate-vs2003-vs2005
📃 590 articles.
⭐ 0 followers.

💬 3 Replies
👁️‍🗨️ 1340 Views

Update:

It actually physically deletes the global.asax.vb file during the conversion process. Why would it do that? Again, it allows me to manually add the global.asax.vb file back in but for the life of me I can't get the code in there to execute. I've tried every permutation. Please help.

This is what my global.asax file looked like after the conversion...

<%

@ Application Inherits="ERSWeb.Global" Language="VB" %>

After I added in the global.asax.vb file I changed it to this...

<%@ Application Codebehind="Global.asax.vb" Inherits="ERSWeb.Global" %>

It doesn't like the fact that the global.asax.vb class is called "Global" but it compiled fine this time so I left it. Urg.

0
ferrethouse
4/12/2006 3:12:33 PM
I'm an idiot. Sorry, I am new to this .NET stuff. It did import the global.asax.vb file it just puts it in a folder called App_Code. I did not realize this. Sorry folks!
0
ferrethouse
4/12/2006 3:20:52 PM

Errethouse, I assume you have converted to Website project.  Global.asax.vb should be  moved to App_Code folder.

Global has became a key word in VB, So you  need to change it to [Global]  in code-behind file to fix your problem. The rest will say as it is.

Baiju


"This posting is provided "AS IS" with no warranties, and confers no rights"
0
Baiju
4/12/2006 5:53:59 PM
Reply: