How do I deploy a Global.asax file? Does it get compiled in release mode to the App_Code.dll?
2 Answers
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.
-
Oh so it doesn't have to be released? its just like web.config? – cdub Aug 30 '12 at 20:06
-
@chris added a section to my answer to address your question in the comment – Icarus Aug 30 '12 at 20:09
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

- 115
- 5
- 12