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.


Posted on Sunday, October 7, 2012 6:09:00 AM GMT by Barnard Starr
Thank you for posting this, it was a lifesaver
Posted on Tuesday, October 9, 2012 7:11:00 PM GMT by anonymous
notepad++ %SystemRoot%\Sysnative\inetsrv\config\applicationHost.config
Posted on Tuesday, November 27, 2012 10:23:00 AM GMT by schglurps
Thank you, this behavior made me crazy !
Posted on Tuesday, January 8, 2013 4:12:00 PM GMT by Philip Wigg
This article was very helpful!
Posted on Thursday, December 5, 2013 1:36:00 PM GMT by Marek
You've saved my sanity!
Posted on Friday, March 21, 2014 5:11:00 PM GMT by Aarohi
I am trying to remove location tags from ApplicationHost.config for a site. I was able to remove the sections under these tags using Appcmd Clear Config. Could you please suggest me how can we remove the whole location block?

Posted on Thursday, March 27, 2014 9:33:00 PM GMT by anonymous
Thank you for this, very helpful.
Posted on Wednesday, April 2, 2014 10:13:00 PM GMT by anonymous
Posted on Wednesday, November 12, 2014 1:17:00 PM GMT by Pramod
Thanks that was extremely handy. Saved me a lotta time.
Posted on Saturday, August 29, 2015 6:03:00 PM GMT by anonymous
Thanks a lot, you saved my day.
Posted on Tuesday, December 22, 2015 3:01:00 PM GMT by anonymous
Thank you for posting this, it waw verry helpful.
Posted on Wednesday, January 27, 2016 1:07:00 PM GMT by anonymous
Thanks alot! You just saved my Day!
Posted on Thursday, March 17, 2016 7:36:00 PM GMT by Joe Bigler
Thanks for the clear explanation. I just posted the information to the notepad++ forum and asked if there was any hope for a 64-bit version.
Posted on Thursday, March 31, 2016 6:26:00 AM GMT by Nassh
Give this man a cookie
Posted on Saturday, June 25, 2016 5:12:00 PM GMT by anonymous
Really a useful tip. Thanks for it.
Posted on Wednesday, December 14, 2016 7:08:00 PM GMT by wojtow
There's now a 64bit version of notepad++ available (check the website) It does the correct thing and is easier to work with the XML than plain notepad.
Posted on Monday, January 23, 2017 1:43:00 PM GMT by jwac
This behaviour was so puzzling. Thank you for the answer!
Posted on Tuesday, February 14, 2017 8:40:00 PM GMT by anonymous
Never heard of this before and just spent half a day not understanding why things weren't working until I found this page. Thanks very much!

Post a comment