IIS 7.5 でホストしたい WCF サービスがあります。私の設定: .svc ファイルのあるフォルダーの物理パスは次のとおりです: C:\inetpub\wwwroot\SmartSolution\Services\Services\ContainerManagementService.svc 私のバイナリは C:\inetpub\wwwroot\SmartSolution\Services\bin にあります。それらを C:\inetpub\wwwroot\SmartSolution\Services\Services\bin にコピーしました
両方のサービス フォルダー用に IIS で 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)
サービスを機能させるにはどうすればよいですか。ありがとう!