如何通过web.config更改IIS的内部configuration?

我想改变IIS上的Web服务项目的身份validation模式,只有基本的身份validation…我使用VS 2010和webDeploy发送我的WCF(数据服务)项目,在我的web.config我有:

<location path="Default Web Site/AdcamApi" allowOverride="false"> <system.webServer> <security> <authentication> <basicAuthentication enabled="true" /> <anonymousAuthentication enabled="false" /> </authentication> </security> <modules runAllManagedModulesForAllRequests="true"> <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <!-- <add name="AuthenticationModule" type="AdcamApi.AuthenticationModule"/> --> </modules> </system.webServer> </location> 

我在webdeploy的日志中看到:“更新setAcl”,所以我认为它是好的,但是当我回到经理身份validation是相同的:

  • 不均衡:启用
  • 基本:禁用

我已经testing了很多东西:allowOverride,不同的位置等,但没有成功。

注意 :

  • 当我直接在IISpipe理器中更改此模式时,我的目录的web.config是不变的!

  • IIS和项目不在同一台机器上(网上configuration)

在IISpipe理器中,select左侧的服务器。 在“pipe理”部分的底部有一个“function委派”图标,将其打开。

为了能够覆盖web.config文件中的configuration,您需要将委派设置为“读/写”,以便更改所有要执行的function。