参照DLLのコードを使用する非同期タスクを実行します。この場合、この参照されたDLLが見つからないというエラーメッセージが表示されます。非同期でアセンブリをロードタスクasp.net
Message: Unable to find assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
StackTrace: at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.AppDomain.Deserialize(Byte[] blob)
at System.AppDomain.UnmarshalObject(Byte[] blob)
コードが非同期タスクの場合、DLLは別の場所から取得されますか? GACにインストールする必要がありますか?
これは私のweb.configファイルである:
binフォルダに<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
私はNewtonsoft.Json.Dllを持って、私はバージョンであるかどうか確認するためにPowerShellスクリプトを実行すると、それは次のとおりです。
[Reflection.AssemblyName]::GetAssemblyName('MyLocation\Newtonsoft.Json.DLL').Version
そして結果は次のとおりです。
Major Minor Build Revision
----- ----- ----- --------
8 0 0 0
それから私はを使用してw3wp.exeのプロセスにロードされたアセンブリをチェックしたいですとがあります:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\xxx\Newtonsoft.Json.DLL
だから私はそこにナビゲートは、DLLをコピーして、バージョンを確認(念のため)、それは私が、私は他に何ができるかわからない8.0.0.0
次のとおりです。 D
コードの一部を表示できますか? – JustinHui
使用しているコードをいくつか投稿する必要があります。現時点で問題がどこにあるのかは分かりません – Piotr
私は、非同期タスクにあるコードと何か関係があるのか疑問です。おそらく、異なるバージョンのJSON.NETを必要とする異なる依存関係があり、バインディングは、アプリケーションがbinフォルダに終わるバージョンを受け入れないように厳密に厳密に設定されています。 – StriplingWarrior