热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

是全球性的。在App_Code.dllasax文件-IsGlobal.asaxfileinApp_Code.dll

HowdoIdeployaGlobal.asaxfile?DoesitgetcompiledinreleasemodetotheApp_Code.dll?如何部署全局

How do I deploy a Global.asax file? Does it get compiled in release mode to the App_Code.dll?

如何部署全局变量。asax文件?它是否以发布模式编译到App_Code.dll?

2 个解决方案

#1


1  

You can deploy only the Global.asax file and it will pick up the changes immediately. Just like changing the Web.config file.

您只能部署全局。asax文件,它将立即接收更改。就像改变网络一样。配置文件。

From MSDN

从MSDN

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...

全球。asax文件,也称为ASP。NET应用程序文件,是一个可选文件,包含响应应用程序级事件的代码…

The ASP.NET Global.asax file can coexist with the ASP Global.asax file. You can create a Global.asax file either in a WYSIWYG designer, in Notepad, or as a compiled class that you deploy in your application's \Bin directory as an assembly. However, in the latter case, you still need a Global.asax file that refers to the assembly.

ASP。净全球。asax文件可以与ASP全局文件共存。asax文件。您可以创建一个全局变量。asax文件可以是在WYSIWYG设计器、记事本中,也可以是作为程序集部署在应用程序的\Bin目录中的编译类。然而,在后一种情况下,您仍然需要一个全局变量。asax文件,指的是程序集。

When you save changes to an active Global.asax file, the ASP.NET page framework detects that the file has been changed. It completes all current requests for the application, sends the Application_OnEnd event to any listeners, and restarts the application domain. In effect, this reboots the application, closing all browser sessions and flushing all state information. When the next incoming request from a browser arrives, the ASP.NET page framework reparses and recompiles the Global.asax file and raises the Application_OnStart event.

将更改保存到活动全局变量时。asax文件,ASP。NET页面框架检测文件已被更改。它完成对应用程序的所有当前请求,将Application_OnEnd事件发送到任何侦听器,并重新启动应用程序域。实际上,这将重新启动应用程序,关闭所有浏览器会话并刷新所有状态信息。当来自浏览器的下一个传入请求到达时,ASP。NET页面框架修复并重新编译全局。asax文件并引发Application_OnStart事件。

#2


0  

You cant directly deploy only Global.Asax. If you want then you can do it by editing DLL. If you are on MVC project then you can see mvcapplication.cs in DLL. There we can apply changes. Its worked for me. I have used .net Reflector with Reflexil 2.1.IMAGE

你不能只直接部署Global.Asax。如果你愿意,你可以通过编辑DLL来实现。如果您在MVC项目上,那么您可以看到mvcapplication。cs在DLL中。在那里我们可以应用变更。它为我工作。我使用了。net Reflector和2.1 image


推荐阅读
author-avatar
专业拍片
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有