George2
George2

Reputation: 45771

Global.asax issue

I am developing an HttpModule and using Global.asax. I have developed a class which derives from HttpApplication, but Application_Start method of my class never executes (I create a file at the beginning of Application_Start but the file never creates, and it is why I think Application_Start never executes). I am using VSTS2008 + C# + .Net 3.5.

Any ideas what is wrong and how to debug? I want to confirm I should copy the Global.asax into the root directory of my web site virtual directory, correct? Should I configure anything in web.config to let the HttpModule run?

Upvotes: 1

Views: 2238

Answers (3)

Tadas Šukys
Tadas Šukys

Reputation: 4220

Application_Start executes only once when an application starts first time. Do you have restarted your application?

Yes, Global.asax must be in the root directory.

You must add your new ASP.NET module into web.config <httpModules> section.

Upvotes: 2

Alex
Alex

Reputation: 38529

you do need to add an entry into web.config http://msdn.microsoft.com/en-us/library/9b9dh535.aspx

Upvotes: 1

BStruthers
BStruthers

Reputation: 958

Did you add your module to the httpModules section in your web.config? See: http://msdn.microsoft.com/en-us/library/ms227673.aspx

Upvotes: 1

Related Questions