2016-10-17 11 views
0

私はVS内の私のKentico Webアプリケーションへのwcfサービス(SifService)参照を追加しました。私は高度なオプションを選択しなかった。私はちょうどwsdlアドレスを提供し、名前空間(SifService)を提供し、OKをクリックします。サービス参照が正常に追加されたようです。しかし、以下のコードのようにクライアントのインスタンスを作成しようとすると、VSは型または名前空間 "SifService"が見つかりませんでした。最近Kentico 8からKentico 9にアップグレードしました。同じ正確なコードは、Kentico 8コードブランチで正常に動作します。この問題は、Kentico 9ブランチにのみ表示されます。私はVSでサイトを実行しようとするとサービス参照が定義されていません

var sifClient = new SifService.SifClient(); 

は、私はブラウザにこのエラーが表示されます。

Parser Error 

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Reference.svcmap: Could not load file or assembly 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 


Source Error: 


[No relevant source lines] 

Source File: /App_WebReferences/SifService/ Line: 1 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded. 

注:私はSifServiceへのサービス参照を追加するまで、すべてがうまく動作します。

答えて

0

時々、ビジュアルスタジオのエラーです。ソリューションをクリーンにしてビルドして、ビジュアルスタジオを閉じてもう一度ビルドしてください。

+0

既に試してみました。ありがとう – ihatemash

関連する問題