IISでホストされているWCFサービスがあり、サービスは正常に動作しています。実際には、次のGlobal.asaxファイルとOrderService.svcファイルを順番に使用しています。ServiceHostのカスタムファクトリをGACからロードできません
<%@ Application Codebehind="Global.asax.cs" Inherits="MyCompany.MyOrderServices.Global" Language="C#" %>
<%@ ServiceHost Language="C#" Debug="true" Service="MyCompany.ServiceLibrary.OrderServiceImpl" Factory="MyCompany.ServiceLibrary.GenericServiceHostFactoryImpl, MyCompany.ServiceLibrary"%>
私は\ bin \ less WCFサービスを作成し、IISでホストしようとしています。私は必要なすべてのアセンブリをGACに入れました。私は次のエラーを取得サービスへの要求を行うときは:だから私はポイントを得た
<%@ Application Codebehind="Global.asax.cs" Inherits="MyCompany.MyOrderServices.Global, MyCompany.MyOrderServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXX" Language="C#" %>
を::I
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: Could not load the assembly 'MyCompany.MyOrderServices'. Make sure that it is compiled before accessing the page.
Source File: /global.asax Line: 1
まあが、私は、Global.asaxのは、以下のようにファイルを変更することで、このエラーを修正しました単純な型名を型のアセンブリ修飾名に変更する必要がありました。実際にGlobal.asaxエラーを修正した後、次のエラーが発生します。
Could not load file or assembly 'MyCompany.ServiceLibrary' or one of its dependencies. The system cannot find the file specified.
それから私は、Fusionのログを有効にし、以下の情報だ:
=== Pre-bind state information ===
LOG: DisplayName = MyCompany.ServiceLibrary
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: MyCompany.ServiceLibrary | Domain ID: 4
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/OrderServicePublish/
LOG: Initial PrivatePath = C:\OrderServicePublish\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\OrderServicePublish\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/98694738/2a3c07d8/MyCompany.MyServiceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/98694738/2a3c07d8/MyCompany.MyServiceLibrary/MyCompany.MyServiceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/OrderServicePublish/bin/MyCompany.MyServiceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/OrderServicePublish/bin/MyCompany.MyServiceLibrary/MyCompany.MyServiceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/98694738/2a3c07d8/MyCompany.MyServiceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/98694738/2a3c07d8/MyCompany.MyServiceLibrary/MyCompany.MyServiceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/OrderServicePublish/bin/MyCompany.MyServiceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/OrderServicePublish/bin/MyCompany.MyServiceLibrary/MyCompany.MyServiceLibrary.EXE.
どうやらGACフォルダがomitedされているが。次に、.svcファイルを次のように変更しました。
<%@ ServiceHost Language="C#" Debug="true" Service="MyCompany.ServiceLibrary.OrderServiceImpl, MyCompany.ServiceLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXX" Factory="MyCompany.ServiceLibrary.GenericServiceHostFactoryImpl, MyCompany.ServiceLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXX"%>
...しかし、私は同じエラーが発生しています。 ServiceHostディレクティブの問題点アセンブリがGACフォルダから読み込まれないのはなぜですか?
(注1:ところで、私は、アセンブリ修飾型名に単純型の名前を変更するために示唆され、以下のリンクをチェックし、それは私のために働いていなかった
不一致があるとアセンブリがロードされないので、GACの名前、バージョン、強力な名前、およびカルチャでアセンブリを手動でチェックしましたか? –
はい@ mrinal-kambojアセンブリのGACを確認しました。 :) – rebulanyum
コンソールアプリケーションで同じリポジトリを試すことができますか?GACからロードされるものはすべて同じですが、環境内の実際の問題に絞り込むことを試みています。システム(PATH)に他のコピーがないことを確認してください。 –