我有一個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