gpt4 book ai didi

wcf - 在 IIS 8.5 上部署 WCF

转载 作者:行者123 更新时间:2023-12-04 06:37:27 25 4
gpt4 key购买 nike

我正在尝试在 IIS 8.5 上部署 IIS 服务应用程序,但每次我尝试通过 http://localhost/test/WCFService.svc 连接到该服务时我得到以下屏幕:

enter image description here

当我去turn Windows features On or OFF我有以下几点:

enter image description here

我的 web.config 如下所示:

<?xml version="1.0"?>
<configuration>

<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name ="MessageServaceBehavior">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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>
<services>

<service name ="WCF_Connection.WCFService" behaviorConfiguration="MessageServaceBehavior">

<host>
<baseAddresses>
<add baseAddress="http://10.0.5.32:58632/WCF_Service/"/>
</baseAddresses>
</host>
<endpoint name ="getMessage" address="" binding="basicHttpBinding" contract="WCF_Connection.IWCFService"/>
<!--<endpoint name ="MessgaeServiceMex" address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>-->

</service>
</services>

<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>

<!-- To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.-->

<directoryBrowse enabled="true"/>
</system.webServer>

</configuration>

是什么原因造成的,我该如何解决这个问题?

最佳答案

您可能缺少 WCF HTTP 激活功能。它位于 Windows 功能屏幕的不同部分(请看下面的屏幕),据我所知,在安装 IIS 时默认情况下它没有启用。

enter image description here

关于wcf - 在 IIS 8.5 上部署 WCF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24493717/

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