【发布时间】: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 具有所需的设置