【问题标题】:Error on <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/> while publish on IIS在 IIS 上发布时 <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/> 出错
【发布时间】:2012-03-28 10:47:35
【问题描述】:

我有一个使用默认方法的测试 wcf 服务,网络配置是:

 <system.web>
    <compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior>
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="true"/>
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

在本地 IIS 上,当我发布它时它工作正常。但是当我尝试在远程 IIS 上发布时,我收到此错误:

描述:处理一个错误 服务此请求所需的配置文件。请查看 下面的具体错误详细信息并修改您的配置文件 适当地。

解析器错误消息:使用注册为的部分是错误的 allowDefinition='MachineToApplication' 超出应用程序级别。这 错误可能是由于未将虚拟目录配置为 IIS 中的应用程序。

Line 23:       </service>
Line 24:     </services>
**Line 25:        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>**
Line 26:  </system.serviceModel>
Line 27:  <system.webServer>

提前致谢。

【问题讨论】:

  • 您要发布到与它所在的机器不同的环境的机器。确保已安装 .NET Framework 且 IIS 具有所需的设置

标签: wcf iis


【解决方案1】:

我得到了解决方案:

在 IIS 中,如果应用程序确实是应用程序,而不是虚拟目录?图标应该是看起来像地球的东西,而不是文件夹的图标。如果没有,请将其转换为应用程序右键单击文件夹选择部署,然后 Application.Service running with

【讨论】:

  • 它以前使用虚拟目录,不确定发生了什么变化 - 可能是我们正在使用的一些 .net 功能需要我们的虚拟目录作为“应用程序”。感谢您的解决方案
  • 如何判断哪个虚拟目录应该是 IIS 中的应用程序?
【解决方案2】:

确保在创建 Web 应用程序时浏览到实际的 Web 文件夹(包含 Bin*.svcweb.config),而不是父文件夹。

【讨论】:

    【解决方案3】:

    如果你使用 framework 4.0 只有一个 ENDpoint 所以写 multipleSiteBindingsEnabled="False" serviceHostingEnvironment multipleSiteBindingsEnabled="False"

    使用它会运行

    【讨论】:

      猜你喜欢
      • 2020-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-01
      • 2017-12-01
      • 2020-12-10
      • 1970-01-01
      相关资源
      最近更新 更多