Assembly Binding Error: Unrecoverable error occurred during pre-download check (hr = 0x80070780)

9

I have a .NET 4.5 application that works and runs with no issues in most environments; however, one area of the application throws a runtime assembly reference error on some client machines:

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)

I ran the fusion logs and interestingly, this assembly seems to be loaded twice, once for version 4.0.0.0 and then for version 3.5.0.0 when Newtonsoft.Json version 6.0.8 is loaded. The first load works and the second is where the binding error comes from.

Here is the Fusion log for the successful 4.0.0.0 bind:

<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 state information ===
LOG: DisplayName = System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
 (Fully-specified)
LOG: Appbase = file:///C:/Users/<user>/AppData/Local/Apps/MyApplicationPath/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyApplication.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\<user>\AppData\Local\Apps\MyApplicationPath\MyApplication.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: Found assembly by looking in the GAC.
LOG: Binding succeeds. Returns assembly from C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll.
LOG: Assembly is loaded in default load context.

</pre></html>

And here is the unsuccessful 3.5.0.0 bind:

<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:41:12 PM) ***

The operation failed.
Bind result: hr = 0x80070780. The file cannot be accessed by the system.

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 state information ===
LOG: DisplayName = System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
 (Fully-specified)
LOG: Appbase = file:///C:/Users/<user>/AppData/Local/Apps/MyApplicationPath/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyApplication.exe
Calling assembly : Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\<user>\AppData\Local\Apps\MyApplicationPath\MyApplication.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: Version redirect found in framework config: 3.5.0.0 redirected to 4.0.0.0.
LOG: Post-policy reference: System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LOG: Binding succeeds. Returns assembly from C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll.
LOG: Assembly is loaded in default load context.
ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070780).

</pre></html>

What really makes no sense to me is that it is loading the assembly from the same exact location, and it just is not working the second time around. I thought this was perhaps due to a lock of some sorts on the GAC assembly, but after checking the Fusion log on a working environment, the log file is the same, just without the final error line, so that is not it.

What is also interesting is that this problem appears to only be happening on Windows 10 machines, but not all Windows 10 machines. It also appears to not be limited to upgrades or fresh Win10 installs; it happens on both.

I have tried numerous things to fix this problem, including:

  • .NET repair
  • fully removing and re-installing .NET
  • clearing temporary ASP.NET files
  • adding assembly binding redirects/probing to the application config files to manually point to the file referenced the application's bin folder or the root folder (tried this for version 3.5, 4.0, and 4.5 of the referenced assembly.
  • Using the Windows 10 Repair functionality to reinstall the OS (and keep the files)
  • Ensuring the required assembly is located in the GAC (in the new GAC location)
  • Republishing the application using the latest version of Newtonsoft.Json.
  • creating a basic test app that references Newtonsoft.Json and the same System.Xml.Linq assembly (that works on the bad machines)

I appear to be running out of options, and unfortunately, I cannot get a more specified error than "Unrecoverable error," so I am not sure where else to look. Any help is greatly appreciated!

c#
.net
windows-10
.net-assembly
system.xml
asked on Stack Overflow Jan 17, 2017 by Bobby Byrnes • edited Jan 17, 2017 by Jester

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0