アプリケーションのサーバーエラー - WCFサービスにアクセスしようとすると

StackOverflow https://stackoverflow.com/questions/5477232

  •  14-11-2019
  •  | 
  •  

質問

私はIIS 7.5でホストしたいWCFサービスを持っています。私のセットアップ: .svcファイルを含むフォルダの物理パスは、次のとおりです.C:\ inetpub \ wwwroot \ smartSolution \ services \ services \ containsermanagementservice.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 /サービス/サービス/ ContainerManagementService .svc 、次のエラーが表示されます。

サーバーエラーIN '/ SmartSolution /サービス/サービス' 応用。 [ServiceActivationException:The サービス '/smartsolution/services/services/containermanagementservice.svc' ANのために起動できません コンパイル中の例外the 例外メッセージは次のとおりです Win32アプリケーション(例外 HRESULT:0x800700C1)。 Win32アプリケーション(例外 HRESULT:0x800700C1)

どのように私はサービスを働くことができますか。ありがとう!

役に立ちましたか?

解決

例外を見ると、アセンブリ(BINフォルダ内の)がターゲットを絞ったX64 Plaformに構築されていて、それらが32ビットモードで設定されている32ビットマシンにデプロイされている(32ビットアプリケーションを有効にする)。「真」)。したがって、プロセスはX64プラットフォーム用に構築されたアセンブリをロードできず、例外で失敗します。

HTH AMIT

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top