articles:

cannot manually edit applicationhost.config

This was a good puzzle (relates to win2008 64bit), here are the steps to replicate:

  • Navigate to Windows\System32\inetsrv\config
  • Open Applicationhost.config in notepadd++
  • Make a change to file and save it
  • Run appcmd list config -section you changed
  • Note change not showing
  • Feel confused
  • Go back to the applicationhost.config file itself open again in notepad++
  • See change still there, despite not showing when using appcmd
  • Feel more confused
  • Repeat as necessary for further confusion

So what could be the cause of this oddity?

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.

Post a comment

name:
(optional)

email:
(optional)

comment:

call us on 01344 762988