Cannot open IIS 7 applicationHost.config in 64-bit Windows with 32-bit text editor

Why can I not open the applicationhost.config file on 64-bit Windows?


Paraphrased from icelava.net forums:

Under x64 Windows certain paths are designated as 64-bit paths, and a 32-bit process, like Visual Studio, is being redirected by Windows to the 32-bit path at C:\windows\SysWOW64 whenever C:\windows\system32 is referenced. The 32-bit process thinks it is looking at C:\windows\system32\inetsrv\config when it has been given C:\windows\SysWOW64\inetsrv\config; which indeed contain none of those configuration files we are after.

To solve (credit to Robert McMurray):

Open a 64-bit command prompt and execute the following commands:

cd /d "%systemdrive%\windows\syswow64\inetsrv"

move config configx86

MKLINK /d Config "%systemdrive%\windows\system32\inetsrv\Config"

It should report

symbolic link created for Config <<===>> C:\windows\system32\inetsrv\Config

This effectively renames the 32-bit config directory so a symbolic link of that name can take its place to redirect back to the 64-bit path which we are really interested in.