views:

749

answers:

3

In my ASP.Net application, I can't get the events in Global.asax.cs to fire on my machine. For instance, Session_Start will not fire.

The same Global.asax.cs works fine on other development machines in my office.

I have tried:

  • Both the ASP.Net Development Server and my local IIS

  • Rebooting the machine

  • Removing and recreating the file from the project (including deleting it
    from disk)

  • All machines are configured the with the same level of software (VS2008
    SP1, .Net 3.5, XP)

This is driving me crazy, any help out there?

EDIT: Since the application works on other machines, I don't think it is directly related to the contents of Global.asax or Global.asax.cs. For some reason, my machine does not process the files. I have done a repair of VS 2008 and .Net 2.0. Any other ideas?

EDIT: The application running on all three machines is being pulled directly from source control. It is definitely something specific to the one machine.

Thanks,

Pat

+1  A: 

Application level events only need proper naming to work. Is your codebehind class being designated in your Global.asax file?

<%@ Application Inherits="YourNamespace.YourApplicationClass" Language="C#" %>
BC
A: 

If you have fiddled with ASP.NET then maybe try reinstalling it.

Jonathan Parker
+1  A: 

This is a long shot but I have been bitten by this before. When you created your Global.asax.cs file did you make sure to include a basic Global.asax file in your project?

Also make sure that the inherits property in that Global.asax is pointing to your custom class (namespace and all) in your Global.asax.cs file.

I had this problem once and it was because I totally forgot to make the Global.asax file and hook it up to my class. I had just copied the Global.asax.cs from another project that did something similar.

Kelsey