How to Edit IIS ApplicationHost file

How to Edit IIS ApplicationHost file?

What is Application Host file?

ApplicationHost.config is the root file of the configuration system when you are using IIS 7 and above. It includes definitions of all sites, applications, virtual directories and application pools, as well as global defaults for the web server settings. 


How this file is Important to us ?

While working on an application you may come across the situation during hosting it on IIS that every time when you worked on the different branch (which is every time the new folder location) you have to manually change the physical location one by one  if your application have a big hierarchy which is quite a hard and time  consuming.

There is a another smart way to change all Application location in one attempt by changing the IIS configuration file in 3 simple steps.

  • Goto the location %windir%\system32\inetsrv\config and copy the “applicationHost” file and paste in some other location, Make sure to keep backup of this file as well.

  • Open this file in any text editor preferably visual studio you’ll see the all application and setting that you have mentioned in IIS are exist in this file.

  • Now do simple find and replace to the old physical application location to the new location and save file. now copy this file and paste in the original location (C:\Windows\System32\inetsrv\config) you’re done now all application are pointing to new location, it’s better to recycle the app pool.

Leave a Comment

Your email address will not be published.