Is there a recommended way to bounce an asp.net application besides touching web.config from inside the application? is HttpRuntime.UnloadAppDomain()
; the preferred way to do this ? and if so where do you do this? In the unload of a page or some other place in the application?
yes we can run asp.net application without web. config file,if u r not configure any settings in web. config file then it will take machine.
Changes to the web. config will trigger the app to be reloaded by IIS as soon as there are 0 connections left to the app. You can also stop and restart the app pool that the app is assigned to in order to make this happen. You do not need to stop and restart IIS itself.
config file is located in the %SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\ folder. The default settings that are contained in the Machine. config file can be modified to affect the behavior of Microsoft .
Touching web.config from inside an application is a bad idea, IMO. Also, the idea of having a file that you modify is a little hackney, IMO.
The documentation specifically states that UnloadAppDomain
will shut the application down:
UnloadAppDomain allows programmatic shutdown of unused applications.
You should be able to make this call anywhere in the application. Mind you, you might get a SecurityException
, so make sure that the runtime gives you the appropriate permissions (you might want to put this in a library and make a call and then set the library up in the GAC with evidence to give it full trust).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With