IIS 7.5 applicationHost.config file is not being updated

后端 未结 2 1569
面向向阳花
面向向阳花 2020-12-25 12:01

I\'m currently playing around with the Microsoft.Web.Administration (MWA) namespace in order to adjust our application to configure IIS 7.5 with the new API. I understood th

相关标签:
2条回答
  • 2020-12-25 12:15

    As a workaround to open and edit the 64-bit IIS configuration files with your favorite 32-bit editor that is 64-bit compatible (i.e. Notepad++), you can create a Windows directory symbolic link which points to C:\Windows\System32\inetsrv\Config. With this method, you are replacing the 32-bit Config directory, located at C:\Windows\SysWOW64\inetsrv\Config to point to the 64-bit version. If, for example, you have an application which requires both 32-bit and 64-bit versions, this method won't work.

    For more information, I strongly encourage you to visit this MSDN Blog.

    0 讨论(0)
  • 2020-12-25 12:28

    I just tried your code and it works fine. You are aware that this mime type is being added to the global mime type collection and not to a site?

    It also gets added to the end of the <staticContent> list, this list isn't re-sorted when you do ServerManager.CommitChanges().

    Also on Windows 2008-R2 the correct location for applicationHost.config is at:

    C:\Windows\System32\inetsrv\config

    I'm guess you're either using notepad.exe or NotePad2 to open this file (32 bit editors can't open it). Notepad won't reload the file upon a change and NotePad2 needs to be told to display a file change notification (alt-F5), out of the box it won't.

    Also try adding something unusual like .xxx, run your update then open the config file and do a search. I guarantee it'll be there.

    Update:

    Further to your comments below, I'm not sure how you're able to open applicationHost.config using NotePad++ or any 32-bit editor, I certainly can't. Can you download NotePad2 which is a 64-bit editor:

    http://www.flos-freeware.ch/notepad2.html

    The release candidate works just fine.

    On a default install of any 64 bit Windows 2008 or Windows 7 there shouldn't be an applicationHost.config in the C:\Windows\SysWOW64\inetsrv\Config folder. I'm not sure why you'd be seeing one there.

    0 讨论(0)
提交回复
热议问题