【发布时间】:2013-12-30 10:41:53
【问题描述】:
我使用 VS2010 创建了一个 wcf 服务,当我从 VS2010 运行它时它可以正常工作,但是当我在 IIS 6 上部署它时(根据 this 帖子),它不起作用。
我做了这些步骤:
- 我在我的服务器 (
C:\WCFServices\HRService) 中创建了一个文件夹,并将HRService.svc和 web.config 复制到其中,并授予ASPNET用户对该文件夹的完全访问权限。 - 我在上述文件夹中创建了一个
Bin文件夹并将我的服务dll 复制到其中。 - 我在我的默认网站中创建了新的虚拟目录(
HR):
我的.svc文件,web.Configs如下:
我的.svc 文件
<%@ ServiceHost Language="C#" Debug="true" Service="HumanResourceService.HRService" %>
还有我的web.Config
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="NewBinding0" />
</basicHttpBinding>
</bindings>
<services>
<service name="HumanResourceService.HRService">
<endpoint address="" binding="basicHttpBinding"
bindingConfiguration="" contract="HumanResourceService.IHRService" >
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
但是当我想通过 IE 访问我的 WCF 服务时,我得到了这个错误:
谁能告诉我,这是什么问题?
【问题讨论】:
标签: visual-studio-2010 wcf iis deployment web-config