我有一个.NET 4.5应用程序,在大多数环境中都可以正常运行和运行; 但是,应用程序的一个区域会在某些客户端计算机上引发运行时程序集引用错误:
Could not load file or assembly 'System.Xml.Linq, Version 4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The file cannot be accessed by the system. (Exception from HRESULT: 0x80070780)
Run Code Online (Sandbox Code Playgroud)
我运行了融合日志,有趣的是,这个程序集似乎加载了两次,一次加载版本4.0.0.0,然后加载版本3.5.0.0加载Newtonsoft.Json版本6.0.8.第一个加载工作,第二个是绑定错误的来源.
以下是成功4.0.0.0绑定的Fusion日志:
<meta http-equiv="Content-Type" content="charset=unicode-1-1-utf-8"><!-- saved from url=(0015)assemblybinder: --><html><pre>
*** Assembly Binder Log Entry (1/16/2017 @ 12:40:06 PM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Users\<user>\AppData\Local\Apps\MyApplicationPath\MyApplication.exe
--- A detailed error log follows.
=== Pre-bind …Run Code Online (Sandbox Code Playgroud)