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
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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.
Method 2
You can also add it from project i.e. right click the project and add new item there you can find or search for Global Application Class template and add it.It’s done.
Method 3
Goto File->New->Project->web->Asp.Net Web Application->select Web form-click Ok.
Now you are done; you see the Global Application file when you select web forms while creating a new project. Try this and let me know.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0