在 IIS 上发布时出错-6ren"> 在 IIS 上发布时出错-我有一个使用默认方法的测试 wcf 服务,Web 配置是: -6ren">
gpt4 book ai didi

wcf - 在 IIS 上发布时出错

转载 作者:行者123 更新时间:2023-12-03 22:30:28 28 4
gpt4 key购买 nike

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

 <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 上发布时,我收到此错误:

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

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


提前致谢。

最佳答案

我得到了解决方案:

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

关于wcf - <serviceHostingEnvironment multipleSiteBindingsEnabled ="true"/> 在 IIS 上发布时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9905911/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com