When setting up an ASP.NET web application using IIS 10, the web server observes the web.config file for changes by default. If the file changes, an automatic app pool recycle is triggered.
Is it possible to set up the IIS to recycle the app pool automatically as well if a specific other file is changed? And can it be located outside the web application's root path, e.g. its parent directory?
Related
When we restart the app pool on our IIS server, the web application that is using that app pool serves an html page from the file system. I'm trying to identify where that name of that file is configured within IIS so that we can change it. We would ideally like to control the behavior of what is served during an APP Pool restart.
I've reviewed all configuration settings within IIS that I'm aware of and can't find a mapping to the error page that is served from disk, which is named "restarting.htm".
I'm using a script to automatically recycle an App Pool.
cd %windir%\system32\inetsrv
appcmd recycle apppool /apppool.name:AppPool
This App Pool was created for a Default Web Site which contains an application called "Application" that I want to browse from command line.
Is it possible or do I have to manually press "browse" whenever I want to launch the web site?
I have installed a new Kentico web application and I can browse the site without any problem. This site is hosted in IIS, Now I want to add some customization and created another web application application using MVC and registering routes etc in application start of global.asax event.
Kentico project also has a global.asax file and it contains some code logic.
When I publish my custom web project, It overwrites the existing default Kentico global.asax with global file from my application and application breaks.
Is there any way to have a 2 different global.asax file in a web application with different names? I want both global files should execute separately.
No, I don't believe you can do that. What you can do is publish your MVC site to an application in IIS instead. You might find the following article from Kentico helpful: Creating virtual directories and application pools in IIS 7.5 and 7.0
I have deployed multiple Web Applications in IIS, When I am deploying a modified Dll for any of this Web Application, I need to restart the IIS to get the effect of the new dll. This impacts other Applications. All of these Applications get restarted as I have restarted IIS. Is there any way by which I can restart the specific Application, for which the modified Dll has been deployed?
Yes. Create a different "Application Pool" for your app (in IIS). Make sure your app is assigned to the new pool.
When your app is deployed, the app pool is automatically restarted (affecting all of the other apps in that pool). By default, everything gets deployed to the default app pool.
In IIS 7.5 I have the following configuration:
Sites
-Site1
--App1
--App2
Site1, App1 and App2 are each running in separate Application Pools. When I update the web.config under App1 it restarts both App1 and App2. Is there anyway to prevent a web.config update in a sub app from restarting the entire site?
When a change is made to a web.config, it is typically the app domain that is unloaded and not the app pool that is recycled (some info on that here). Site1, App1, and App2 should each be defined as separate applications and not just virtual directories. Each application will be running in its own app domain, so replacing or changing a web.config should not affect the others unless it is a child application that is inheriting settings from the parent web.config. Depending on the change, making a change to the Site1 web.config could end up causing the app domain for App1 and App2 to unload.
If App1 and App2 are using the same web.config (i.e. if both document roots are pointing to the same file system location) then making a change to the web.config will end up unloading the app domain for both applications.
You can change the App Pool behavior so that a config file change does not cause an app pool recycle.
App Pools -> Your App Pool -> Advanced Settings -> Recycling/Disable Recycling for Configuration Changes = True
(default value is False)