Applicationhost.config not showing changes
Asked Answered
S

2

7

We have a webserver hosted in Microsoft Azure. It's a Windows Server 2008 R2 Datacenter edition, 64 bit.

For a website hosted on this machine, I need to make changes to the applicationhost.config file. However, changes I made to IIS recently are not shown in the config. I've added a new application pool and added this specific website to that application pool. I restarted the website, the 'Date Modified' of the file is updated, but the application pool is not present.

Right now I'm editing the file in C:\Windows\System32\inetsrv\config, but there's also one in C:\Windows\SysWOW64\inetsrv\Config, but the latter hasn't updated for months.

Am I looking at the wrong file? Are changes not saved right away? Do I need to restart IIS completely and not just the relevant website?

Stirring answered 15/4, 2016 at 8:7 Comment(3)
Could it be that the changes are cached? A full IISRESET should let you know whether the changes are updated or not.Burris
Thanks @RickStrahl I'll give that a try when I can, the server is currently in use.Stirring
beaconitservices.com/blog/2016/11/… This link have one description related to question.Wo
S
10

The solution was to restart IIS as @RickStrahl mentioned, but even though it seems you can properly open and edit the applicationHost.config with Notepad++ or the Visual Studio installed on the server and configured to open .config files, it's not actually showing you the correct content!.

I installed Notepad2 x64 and then I could see the application pool I was looking for.

Bloody brilliant Microsoft... :[

Stirring answered 26/4, 2016 at 8:3 Comment(2)
As the articled linked to by Sanket Patel says, the actual issue is that the 32 bit version running on a 64bit machine, gets the open file request as C:\Windows\SysWOW64\inetsrv\Config\applicationhost.config (as you say, the OS does this) and thus isn't editting the file you think it is. If you use the 64bit version of Notepad++, it should work the same as Notepad2.Declarant
I am experiencing some weird voodoo with this. Using the same Notepad++ , for the same file, sometimes I'm being served the correct content. Sometimes, some very old content.Hadley
G
13

The real issue is that there are two inetsvr directories, one for 32 bits and another for 64 bits. The 32 bits 'version', probably dormant and not updated, is under SysWOW64 !!!

When you open a file on %SystemDrive%\Windows\System32\inetsrv using a 32bits application, Windows will redirect you, with no warning, to %SystemDrive%\Windows\SysWOW64\inetsrv possible a very obsolete file. Interesting no?

Using a 64bits editor like Notepad++ will open the 'right' active configuration file.

The following hack will make the (active) 64 bits location, accessible from 32 bits apps (for example, some Visual Studio versions).

cd /d "%SystemDrive%\Windows\SysWOW64\inetsrv"
move Config Config.OLD
mklink /d Config "%SystemDrive%\Windows\System32\inetsrv\Config"
Gyromagnetic answered 25/8, 2017 at 20:30 Comment(0)
S
10

The solution was to restart IIS as @RickStrahl mentioned, but even though it seems you can properly open and edit the applicationHost.config with Notepad++ or the Visual Studio installed on the server and configured to open .config files, it's not actually showing you the correct content!.

I installed Notepad2 x64 and then I could see the application pool I was looking for.

Bloody brilliant Microsoft... :[

Stirring answered 26/4, 2016 at 8:3 Comment(2)
As the articled linked to by Sanket Patel says, the actual issue is that the 32 bit version running on a 64bit machine, gets the open file request as C:\Windows\SysWOW64\inetsrv\Config\applicationhost.config (as you say, the OS does this) and thus isn't editting the file you think it is. If you use the 64bit version of Notepad++, it should work the same as Notepad2.Declarant
I am experiencing some weird voodoo with this. Using the same Notepad++ , for the same file, sometimes I'm being served the correct content. Sometimes, some very old content.Hadley

© 2022 - 2024 — McMap. All rights reserved.