部署对 global.asax 的更改
我继承了一个需要一些维护的网络应用程序,并且我所做的所有更改都恰好位于 global.asax 文件中。一些谷歌搜索告诉我,这是动态编译的(不存在 global.asax.cs 代码隐藏),所以我想我可以通过将新文件放入应用程序的根目录来部署更改。结果发现那里没有global.asax文件,但/bin文件夹中有一个App_global.asax.compiled。我在我的开发机器上的任何地方都找不到这个 .compiled 文件,因此假设它仅由 IIS 创建(而不是 asp.net 开发服务器)。
作为实验,我停止了应用程序池,重命名了 .compiled 文件,将 global.asax 复制到应用程序根文件夹并重新启动应用程序池。几分钟后,.compiled 没有从我的新 global.asax 中重新生成,因此我恢复了更改。
如何将更改添加到实时应用程序中?该应用程序非常大,有相当多的 dll,因此我想尽可能避免进行完整部署。
谢谢
I've inherited a web app in need of some maintenance and all of the changes I've made happen to be in the global.asax file. A bit of googling tells me that this is dynamically compiled (there is no global.asax.cs codebehind present) so I figured I could deploy the changes by just dropping the new file into the app's root directory. Turns out there is no global.asax file to be found in there, but there is an App_global.asax.compiled in the /bin folder. I can't find this .compiled file anywhere on my dev machine so assume its only created by IIS (and not the asp.net development server).
As an experiment I stopped the app pool, renamed the .compiled file, copied the global.asax to the app root folder and restarted the app pool. After a couple of minutes the .compiled was not regenerated from my new global.asax so I reverted the changes.
How do I get my changes into the live app? The app is pretty big with quite a few dlls so I'd like to avoid doing a full deployment if possible.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
App_global.asax.compiled 文件的存在告诉我,您的 ASP.NET 项目已配置为编译所有内容,并且不会将 as*x 文件保留为可编辑状态。我什至不确定 .asax 文件是否可以像 .aspx 文件一样保持可编辑状态。但你的肯定是编译进来的。
因此,我相信你将不得不重新编译和重新部署整个东西。
The presence of the App_global.asax.compiled file tells me that your ASP.NET project is configured to compile everything and not leave the as*x files as editable. i'm not even sure if the .asax file can be left as editable like .aspx files can. But yours is definitely compiled in.
For that reason, I believe you're going to have to recompile and redeploy the whole thing.
检查服务器上的bin文件夹,如果它包含App_Code.dll或类似的东西,那么它可能是在调试模式下发布的,你应该以预编译模式发布项目,并且只上传App_code.dll以使global.asax中的更改生效
Check the bin folder on the server, if it contains App_Code.dll or something similar then it's probably published in debug mode and you should publish the project in precompiled mode and only upload App_code.dll for the changes in global.asax to take effect
您不能仅直接部署
Global.Asax
。如果您愿意,可以通过编辑 DLL 来实现。如果您使用的是 MVC 项目,那么您可以在 DLL 中看到mvcapplication.cs
。在那里我们可以应用更改。它对我有用。我已将 .net Reflector 与 Reflexil 2.1 一起使用。说明
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 seemvcapplication.cs
in DLL. There we can apply changes. Its worked for me. I have used .net Reflector with Reflexil 2.1.DESCRIPTION