vs 2010类库中的Global.asax文件 [英] Global.asax file in vs 2010 Class Library

查看:121
本文介绍了vs 2010类库中的Global.asax文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在网站中添加了global.asax文件...但是我试图将global.asax文件添加到类库中..但是我没有找到Global Application Class文件

请帮帮我

预先感谢


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

推荐答案

Global.asax文件(也称为ASP.NET应用程序文件)是一个可选文件,其中包含用于响应应用程序级事件的代码由ASP.NET或HttpModules提出.

请阅读Global.asax的用途: MSDN:Global.asax文件 [^ ]

此外,请仔细阅读本文,确保您阅读文章中的生命周期事件和Global.asax文件"部分: ^ ]

试图在类库中添加或期望Global.asax没有意义.请不要尝试.
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.


我尝试创建一个新的WCF服务应用程序以及一个ASP.Net Web应用程序.在WCF应用程序中,我立即在添加新项"窗口中看到了全局应用程序类",对于ASP.Net Web应用程序,我必须删除自动创建的global.asax文件,以在添加新项列表"中查看全局应用程序文件".如果您尝试添加一个新的项目,而这又可能是您在该列表中看不到该选项的原因.
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.


在解决方案资源管理器中,右键单击并添加新项目,在它会显示您的列表,您必须选择global.asax.

您以这种方式尝试过吗?
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?


这篇关于vs 2010类库中的Global.asax文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆