2017-01-30 3 views
0

アプリケーションをサービスとして実行するとアセンブリエラーが発生します。これは、Visual Studioから直接プロジェクトを起動するときには発生しません。以下は完全なエラーメッセージです。エラーがこのようです:アセンブリ名を比較サービスとして実行中のアセンブリエラー

は不一致の結果:公開キートークン

誰もがPUBLIC KEY TOKENが何であるかを知っているとどのようにこの問題を修正するには?

30/01/2017 11:06:41 a.m.: System.IO.FileLoadException: Could not load file or assembly 'ClearScript, Version=5.4.4.0, Culture=neutral, PublicKeyToken=935d0c957da47c73' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 
File name: 'ClearScript, Version=5.4.4.0, Culture=neutral, PublicKeyToken=935d0c957da47c73' 
    at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type) 
    at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) 
    at System.Reflection.Assembly.GetType(String name) 
    at Microsoft.ClearScript.V8.V8Proxy.GetImplType(Type type) 
    at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args) 
    at Microsoft.ClearScript.V8.V8IsolateProxy.Create(String name, V8RuntimeConstraints constraints, Boolean enableDebugging, Int32 debugPort) 
    at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort) 
    at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags) 
    at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints) 
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort) 
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort) 
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8ScriptEngineFlags flags, Int32 debugPort) 
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8ScriptEngineFlags flags) 
    at NinoJS.Core.Main.RunScript(Object filePath) 

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll 
Running under executable C:\NinoJS\NinoJS\NinoJS.Service.exe 
--- A detailed error log follows. 

=== Pre-bind state information === 
LOG: DisplayName = ClearScript, Version=5.4.4.0, Culture=neutral, PublicKeyToken=935d0c957da47c73 
(Fully-specified) 
LOG: Appbase = file:///C:/NinoJS/NinoJS/ 
LOG: Initial PrivatePath = NULL 
Calling assembly : ClearScriptV8-32, Version=5.4.4.0, Culture=neutral, PublicKeyToken=935d0c957da47c73. 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\NinoJS\NinoJS\NinoJS.Service.exe.Config 
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. 
LOG: Post-policy reference: ClearScript, Version=5.4.4.0, Culture=neutral, PublicKeyToken=935d0c957da47c73 
LOG: Attempting download of new URL file:///C:/NinoJS/NinoJS/ClearScript.DLL. 
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN 
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated. 
+0

これはもっと深刻なようです:System.IO.FileLoadException:ファイルまたはアセンブリ 'ClearScript、バージョン= 5.4.4.0を読み込めませんでした。 DLLが実行可能ファイルと同じフォルダにあることを確認します。 – invalidusername

+0

@invalidusernameライブラリは同じフォルダにあります。これは最初にチェックしたものです – NicoRiff

+0

システムユーザ(デフォルト)ではなくウィンドウのローカルユーザでWindowsサービスを実行するように設定してみてください。 Windowsサービスのプロパティでこの設定を見つけることができます。それは助けることができます。 –

答えて

0

それは、ログ、ClearScriptV8-32からのように見えますが、そのDLLの非署名のバージョンにリンクされているが、すべてのローカルバージョンが署名されています。

あなたはClearScriptV8-32を自分で構築する場合には - 署名のバージョンにClearScriptポイントを参照する場合は、ILDASMとそうでない場合は、二重のチェックをチェックClearScriptV8-32は確かに非署名バージョンを参照し、別のバージョンを提供するために、所有者に依頼すること。

詳細はthis forum threadを参照してください。

関連する問題