我有一個WCF服務,我想在IIS 7.5中託管。我的設置: 帶有.svc文件的文件夾的物理路徑是:C:\ inetpub \ wwwroot \ SmartSolution \ Services \ Services \ ContainerManagementService.svc 我的二進制文件位於C:\ inetpub \ wwwroot \ SmartSolution \ Services \ bin和我也將它們複製到 C:\ inetpub \ wwwroot \ SmartSolution \ Services \ Services \ bin應用程序中的服務器錯誤 - 嘗試訪問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,將顯示以下錯誤:
服務器錯誤 '/ SMARTSOLUTION/Services/Services' 應用程序。 [ServiceActivationException: 服務 '/SMARTSOLUTION/Services/Services/ContainerManagementService.svc' 無法在編譯期間由於 異常而被激活。 異常信息是:不是有效的 Win32應用程序。 (例外從 HRESULT:0x800700C1)。]不是有效的 Win32應用程序。 (例外從 HRESULT:0x800700C1)
我怎樣才能讓服務工作。謝謝!
實際修復是這樣的:1.內IIS(7)單擊應用程序池。 2.在列表中找到爲您的Web應用程序配置的應用程序池。 3.選擇它,然後單擊右側的高級設置。 4.列表中的第二項設置:啓用32位應用程序 - 必須設置爲True。 – laconicdev 2011-03-29 19:39:43
非常感謝您的評論 – 2014-09-30 11:53:14