Reputation: 25731
How do I deploy a Global.asax file? Does it get compiled in release mode to the App_Code.dll?
Upvotes: 0
Views: 4150
Reputation: 115
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
Upvotes: 0
Reputation: 63972
You can deploy only the Global.asax
file and it will pick up the changes immediately. Just like changing the Web.config
file.
From 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...
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.
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.
Upvotes: 1