105

Where does IIS7 saves its configuration for each virtual directory/ application and its physical path?

Is it an XML file? And if so, will editing this XML file affect the IIS configuration (after restarting)?

Royi Namir
  • 144,742
  • 138
  • 468
  • 792

2 Answers2

166

It sounds like you're looking for applicationHost.config, which is located in C:\Windows\System32\inetsrv\config.

Yes, it's an XML file, and yes, editing the file by hand will affect the IIS config after a restart. You can think of IIS Manager as a GUI front-end for editing applicationHost.config and web.config.

jpaugh
  • 6,634
  • 4
  • 38
  • 90
RickNZ
  • 18,448
  • 3
  • 51
  • 66
  • Is the file is locked ? ( while runnning ?) Can I edit it without any un-lock's ? – Royi Namir Dec 28 '11 at 07:24
  • 2
    No, it's not locked. You might want to make a copy before you make any edits, though. – RickNZ Dec 28 '11 at 11:53
  • 1
    Also the file might not display the actual info for non-admin access as explained [in this question and a comment to an answer](http://stackoverflow.com/questions/7637268/iis-7-5-app-pool-not-in-applicationhost-config) – Pavel K May 30 '14 at 08:17
  • 9
    By restart, it needs a full windows reboot not just IISRESET – Markive May 31 '14 at 06:52
  • 3
    Windows Server 2012 R2 doesn't appear to require a restart, at least when adding new application pools and web sites. – James Skemp Sep 08 '16 at 18:14
55

Also check this answer from here: Cannot manually edit applicationhost.config

The answer is simple, if not that obvious: win2008 is 64bit, notepad++ is 32bit. When you navigate to Windows\System32\inetsrv\config using explorer you are using a 64bit program to find the file. When you open the file using using notepad++ you are trying to open it using a 32bit program. The confusion occurs because, rather than telling you that this is what you are doing, windows allows you to open the file but when you save it the file's path is transparently mapped to Windows\SysWOW64\inetsrv\Config.

So in practice what happens is you open applicationhost.config using notepad++, make a change, save the file; but rather than overwriting the original you are saving a 32bit copy of it in Windows\SysWOW64\inetsrv\Config, therefore you are not making changes to the version that is actually used by IIS. If you navigate to the Windows\SysWOW64\inetsrv\Config you will find the file you just saved.

How to get around this? Simple - use a 64bit text editor, such as the normal notepad that ships with windows.

Markive
  • 2,350
  • 2
  • 23
  • 26
  • 13
    Another approach is to use the administrative c$ to allow 32 bit programs to read\write as if they were 64 bit since the windows file share service is 64 bit: `\\yourservername\c$\Windows\System32\inetsrv\config` – Tim Lewis Jun 27 '14 at 01:42
  • You can also use the info from @TimLewis and use your machine name if it's your local machine that you want to edit with a 32-bit editor. – hacker May 09 '16 at 13:18
  • 1
    Just wanted to note that Notepad++ is fully 64bit for a while now. – Alex from Jitbit May 20 '19 at 13:25