Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i added global.asax file in website...but i am trying to add global.asax file to class library..but i didn't find Global Application Class file

Please help me

Thanks in advance
Posted
Updated 10-Oct-12 2:14am
v2

The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level events raised by ASP.NET or by HttpModules.

Please read what Global.asax is for: MSDN: Global.asax File[^]

Also, have a walk through this article, make sure you read "Life Cycle Events and the Global.asax file" section in the article: MSDN: ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0[^]

Trying to add or expecting a Global.asax in a class library does not makes sense. Please don't try.
 
Share this answer
 
Comments
.net333 11-Oct-12 1:24am    
Thank you sandeep
Sandeep Mewara 13-Oct-12 1:22am    
Welcome.

I tried creating a new WCF Service Application as well as an ASP.Net Web Application. In the WCF Application I straight away saw Global Application Class in the Add New Item window and in case of the ASP.Net Web Application i had to delete the automatically created global.asax file to see Global Application File in the Add New Item List. If you are trying to add a new one while one exists thats probably the reason you dont see such an option in that list.
 
Share this answer
 
Comments
.net333 10-Oct-12 4:30am    
i deleted automatically generated Global.asax file and I try to add file but i didn't find Global.asax file
TheCoolCoder 10-Oct-12 4:32am    
What exactly is ur ProjectType: WCF Service Library or WCF Service Application
.net333 10-Oct-12 4:52am    
Wcf Service Library..and I didn't find Global.asax File in Asp.net Also
TheCoolCoder 10-Oct-12 5:00am    
AFAIK Service Library project will be compiled to create a dll file which could be used in other applications which can have their own Global.asax files. So i think there is no case of a global.asax file with application settings and events inside a service library and that is the reason you cant add a Global.asax file to it. Regarding ASP.Net Web Application I am having no issues in adding a new Global.asax once the default one is deleted. Maybe its something else you do thats causing the problem or its something to do with your VS2010 installation.
In solution Explorer ,use right click and add new item, in that it will show list from you have to choose global.asax.

have you tried in this way?
 
Share this answer
 
Comments
.net333 10-Oct-12 4:29am    
i tried but i didn't find Global.asax file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900