IIS 7.5 applicationHost.config file is not being updated

后端 未结 2 1576
面向向阳花
面向向阳花 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: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 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.

提交回复
热议问题