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...


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.


4/11/2006 10:39:48 PM 590 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 10


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.

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!
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.


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

Similar Artilces:

Migrate code from to
Hello friends, I had created a web site using visual studio 2005. web site was created using the language vb i.e. Now as per the clint requirement I have to migrate all the code in C#. So the question is that is there any tool or any inbuild utility in Visual Stuidio so that we can migrate the site from to Or we have to do it mannually i.e. by changing each and every line of code mannually? Kindly suggest me. Thanks & Regards Girish NehteThanks & RegardsGirish NehteIf This post helps you to solve your problem please mark this as an answer. Hi, at the mome...

Problems in migrating code from VB to VB.NET
Hi,  We are trying to upgrade VB code to .NET. In VB these following lines have been used to accomplish a batch replication functionality. ' Opens an HTTP request handle.Public Declare Function HttpOpenRequest Lib "wininet.dll" Alias "HttpOpenRequestA" _(ByVal hHttpSession As Long, ByVal sVerb As String, ByVal sObjectName As String, ByVal sVersion As String, _ByVal sReferer As String, ByVal something As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long We are not able to find the exact equivalent in .NET to implement this. Can you please provide inputs on how to change this i...

How to migrate code from to
Hi all,If anybody knows information on migration of VB.Net application to i.e Any tools available, best practices, methodology for estimation. etc.   RegardsHelen    Hey, Take a look at this topic some of these sites can be of help to you.  Arnold you can do it by page by page just copy and paste ur page in the following link and convert ur to c# gotcha!!YasserSpica.www.spica.aewww.bncnetwork.netPlease remember to mark as answers i...

VB.NET Using the Global.asax.vb file
Good Morning All,  I am in the process of building a set of applications which our uses will use to build and consume an XML files needed to transfer data between source and destinations servers.  For the time being during development I am storing several variables (users net gateway, ID and PW and some path information) in the "Global.asax.vb" file in the "Application_Start" subroutine.   But for some reason, when the code calls for a variable I am not reading the "Global.asax.vb" file.  So, the application is failin...

Missing Global.asax and Global.asax.vb
Hello all, I am following this example for form authentication ( and It mentions Global.asax and Global.asax.vb files. I did not have these so I found a post about adding the Global.asax as it is not in by default in VS 2008. The issue is that there was not an accompianing Global.asax.vb file. I tried adding a class and naming it Global.asax.vb but somehow I do not think that it is going to work. Any thoughts?   Thanks,   Ty There is no code behind for Global.asax the code goes within the markup Thanks for the information. That helps...

Upgrade/migration issues from VS2003+.NET 1.1 to VS2005+.NET 2.0
Hi,  Visual Studio is great when everything works well and you don't know what is happening under the hood. However when things don't work it is really frustrating since you just don't know what is going on.  I have a project (a web site) that was originally developed for VS2003 and ASP.NET 1.1. When I loaded this project on VS2005 (and ASP.NET 2.0), VS told me that it will migrate it to the new environment: it did a number of things, generated a migration report and created/moved files under App_code and such directories. I tried this process a number of times b...

How to convert C#.Net code to VB.Net code ???...
HI, i was searching something new, then i suddenly find some tips to convert C#.Net code to VB.Net but i did not do well. i am puttint its url here plz tell me how to convert C#.Net code to VB.Net. Jasim...Please remember to click “Mark as Answer” on the post that helps youJasim AkhtarNew Delhi ( INDIA ) It would be better if you write the problem you having, while converting from C# to VB.NET. You cannot completely rely on online converters. ThanksMark post(s) as "Answer" that helped youElectronic ScrewWebsite||Bl...

Translate code to code
Hi I can usually do the translation myself, but this time I am a bit stumped  Let us consider to rewrite Urls (more than 16000 links) using a table. Save original url and rewritten url in a table. Now add a class file in App_Code folder. class UrlRewriteModule : IHttpModule{    public void Dispose()    {        // Nothing to dispose    }    public void Init(HttpApplication context)    {        context.BeginRequest += new EventHandler(context...

How to public an variabel in global.asax.vb and use it in an asax.vb
I have a namespace called MyNewNamespace It is like this in global.asax.vb namespace UgotIT Public class Global Public MyName as String = "Pelle" End Class End namespace In the control.asax.vb imports UgotIT.Global namespace UgotIT Public class Control Dim LblTest As System.Web.UI.WebControls.Label LblTest.Text = MyName End Class End namespace Even if I try to set UgotIT.Global.MyName, Global.Myname och just Myname I always get the error "Reference to a non-shared member requires an object referen...

Is there a software to convert VB codes to codes automatically?
hi there! Do anyone of you know if there is any software to convert VB codes to codes? Or must i maunally convert them? Visual Studio.NET 2000 and 2003 versions automatically convert VB 6 code to VB.NET code, for the most part. Refer to Preparing Your Visual Basic 6.0 Applications for the Upgrade to Visual Basic .NET for more information. Hope this helps, AppanASP.NET Team This posting is provided "AS IS" with no warranties, and confers no rights. thanks! =) Is this case same for Visual C codes? Same concept. Refer to Managed Extensions for C++ Migratio...

Upgraded VB.NET from VS2003 to VS2005
I have added new components in C#.  The C# code preforms normally.  But changes in the VB code are not executed.  I can step through the VB code and watch it execute code that is no longer there.  I have run clean, and rebuilt the solution and web site. But I still get old code executed.  Where is the old module stored and how can I replace it? Thanks, Hi, Based on my understanding, when you run the code, the changes on the code is not applied. If we insert the breakpoint on that code, does it can be hit or show some warning message on the breakpoint? This looks ...

VB to VB.Net Migration
I am new to .Net environment. Suppose i want to migrate a project from VB to VB.Net. Weither i need to recode the complete project or is there any option in .Net to convert VB project to VB.Net project. i converted my vb application to .net by mainly keeping the logic intact and moving it to the code behind. apart from that, since vb .net is really oo based with inheritance etc, i had to pretty much re-write my code vish...

VB code to VB.Net
I have a contact manager application who has released a SDK that allows outside programs to manipulate its data. The examples are provided for VB and C++ developers. In the VB code examples, there is .bas and .frm files. There are also .vbp and .vbw files. There is also a Global.bas file that looks like it contains the global variables and a public function to handle logins. I have also identified a .scc file that is commented "source code control file". I would like to move this code into the .Net framework if possible, but I would like suggestions on where to start. I'm ge...

When does Application_start in Global.asax.vb gets executed?
I use application_start sub to load some application variables and store them in Application("something"). I expect everytime the client brings up my initial page this sub will kick in and I can always get the value stored in Application("...") throughout the current session. But it did not happen as what I expected. I must be wrong. Can someone point me the right direction (store and retrieve control variables). Thx. Application_OnStart fires on the first request after the application has been started by IIS. Let's say that your server needed to be rebooted (a ne...

Web resources about - Global.asax.vb code not executing -

Self-executing rule - Wikipedia, the free encyclopedia
The self-executing rule , also known as " deem and pass ", is procedural measure used by the U.S. House of Representatives to approve legislation. ...

Islamic State video purports to show boy executing two Russian 'spies'
Executions of captives by the Sunni Muslim militants of the Islamic State have become grimly commonplace, but a newly surfaced video featured ...

Islamic State video purports to show boy executing two Russian 'spies'
Executions of captives by the Sunni Muslim militants of the Islamic State have become grimly commonplace, but a newly surfaced video featured ...

Parramatta shooting: police leave empty-handed after executing search warrant at mosque
Police executed a search warrant at a Parramatta mosque overnight as part of their investigations into the fatal shooting on Friday of a civilian ...

US states having trouble executing their citizens
Despite a Supreme Court ruling allowing a controversial drug to be used for lethal injections in Oklahoma, death-penalty states are finding it ...

Islamic State video purports to show boy executing 'Russian spies'
Islamic State releases video that purports to show a young boy executing two men accused of working for Russian intelligence.

Boko Haram executing elderly in northeast Nigeria
Islamic extremists in northeast Nigeria are turning their guns on elderly people, killing more than 50 this week in a new tactic that has instilled ...

New iOS security exploit lets apps read users’ information by executing unsigned code
Security expert Charlie Miller has found a flaw in code signing on iOS devices (via Forbes) that allows developers to sneak malware apps onto ...

Law Journal Apologizes For Article About Executing Law Professors, Professor Resigns
Insane law review article prompts professor's resignation... but how did he get hired in the first place?

Resources last updated: 12/17/2015 6:28:36 PM