我有一个WCF服务,我想在IIS 7.5中托管。我的设置: 带有.svc文件的文件夹的物理路径为:C:\ inetpub \ wwwroot \ SmartSolution \ Services \ Services \ ContainerManagementService.svc 我的二进制文件位于C:\ inetpub \ wwwroot \ SmartSolution \ Services \ bin在IIS 7.5中托管WCF服务的错误
我已经在IIS中为两个Services文件夹创建了一个Web应用程序。
下面是WCF端点配置文件:
<service behaviorConfiguration="MyNamespace.ContainerManagementServiceBehavior"
name="MyNamespace.ContainerManagementService">
<endpoint address="" binding="basicHttpBinding"
name="ContainerManagementbasicHttpEndpoint" contract="MyNamespace.IContainer"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<behaviors>
<behavior name="MyNamespace.ContainerManagementServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</behaviors>
这里是我的.svc文件makrkup:
<%@ ServiceHost Language="C#" Debug="true" Service="MyNamespace.ContainerManagementService" CodeBehind="ContainerManagementService.svc.cs" %>
当我尝试导航到:http://localhost/SmartSolution/Services/Services/ContainerManagementService.svc,将显示以下错误:
类型'MyNamespace.ContainerManagementService',作为ServiceHo中的Service属性值提供st指令无法找到。
如何才能使服务工作。谢谢!
Darin,我的网站是预编译的。但是,即使在删除CodeBehind属性后,我仍然收到相同的错误。 – laconicdev 2011-03-29 18:03:44