【发布时间】:2014-05-28 06:18:29
【问题描述】:
我正在尝试在 IIS 服务 7.5 中托管 WCF 服务,但是当我尝试浏览 svc 文件时从 IIS 管理器向我抛出此错误
当我尝试从 Visual Studio 2012 本身运行 svc 文件时,它再次从我这里完美打开
我哪里做错了? 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>
<services>
<service name="GreetMeWcfServiceLibrary.GreetMeService">
<endpoint address="" binding="basicHttpBinding" contract="GreetMeWcfServiceLibrary.IGreetMeService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- 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>
<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 服务库应用程序定义服务,然后尝试使用 WCF 服务进行托管。
此外,当我右键单击并单击 web.config 文件的 WCF 配置时,它显示没有服务,但我已添加对该服务库 dll 的引用。
非常感谢任何帮助:(
【问题讨论】:
-
查看stackoverflow.com/questions/5385714/… 以查找实际错误。