Tutorial :Why is global.asax missing from a Website Project


A couple of questions regarding the role of global.asax:

  1. Why is it not included in the Website Project in Visual Studio? Are there other ways of achieving the same functionality without this file?

  2. If I would create a Web Application project, as far as I remember, a global.asax file would be created. If I were to delete it, would the project run?

I tried to look for some explanation regarding the global.asax compilation but didn't find any info about this.. would appreciate help/links. :)



An ASP.NET site can run without the global.asax file. Here is a question which talks about alternatives of global.asax file.

Even if you delete a global.asax file your site will work.


Globax.asax is not required by ASP.NET for a website to run. It is, however, very useful for application-level functionality (like unhandled exception logging).


  1. You can add Global.asax to the website project and it will work fine.
  2. Global.asax is not added by default for web applications. If you have it, you can delete it without problems.

Be careful to include the .compiled files when deploying the website or else the events in Global.asax will not fire.


It sounds like you are familiar with Web Application Projects, now see a Web Site "project" and wonder what's going on. In any case, I'll answer as though that were true. ;-)

In Visual Studio 2005, Microsoft introduced Web Site "projects", which are not projects - they're just directory structures on a local disk, FTP site, etc. They do many things differently from Web Application Projects, and can therefore be confusing (especially if you're like me, trying to answer people's questions, not knowing which they are using).

With Visual Studio 2005 SP1, they restored Web Application Projects. If that's what you're more familiar with, then I suggest you use them. They're real projects, just like they always were.

And, BTW, there will be a global.asax, just like there used to be...

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »