Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Global.asax file is missing on my Asp.Net Empty Web application project

Tags:

I have created a C#-> Asp.Net Empty Web Application (Framework 4.0). I want to add few line of code in Global.asax on Application_Error section. But unfortuantely global.asax file is missing. How can i add that file? My visual studio version is 2012

like image 600
Selva Avatar asked Oct 23 '14 19:10

Selva


People also ask

Where is my global asax file?

The Global. asax, also known as the ASP.NET application file, is located in the root directory of an ASP.NET application. This file contains code that is executed in response to application-level and session-level events raised by ASP.NET or by HTTP modules.

Can we run ASP.NET application without global asax file?

An ASP.NET site can run without the global.

How do I add a global asax file?

How to add global. asax file: Select Website >>Add New Item (or Project >> Add New Item if you're using the Visual Studio web project model) and choose the Global Application Class template. After you have added the global.

Is global asax mandatory?

asax. So answers: 1) No, not mandatory.


1 Answers

You can add a new file to the project of type Global Application Class

File -> New -> File -> Global Application Class 

Alternately, you can create a new temporary project, which should generate a Global.asax file. Then just copy/paste that into your project.

like image 170
trnelson Avatar answered Oct 05 '22 07:10

trnelson