Missing file Microsoft.ServiceHub.HostLib.resources.DLL after VS2019 & Framework 4.7.2 upgrade


Firstly, apologies if I don't get this formatted as nicely as I see questions here usually are, this is my first post here.

I may need to go back into the depths of the history of this but initially hoping there might be a fairly simple solution, the crux of it seems to be a file missing, namely...


...so am posting something of a summary version of the problem initially. I'm more than happy to expand on it if needs be.

I've been updating a 5 year old 6-project C# MVC3 solution to MVC5, Net Framework 4.7.2 with some Net Core 2.2 mixed in (just to make things worse) and after rafts of NuGet updates it's now building again.

When I run my solution (more details of it below), I am getting:

Exception Thrown

Managed Debugging Assistant 'BindingFailure'
Message=Managed Debugging Assistant 'BindingFailure' : 'The assembly with display name 'Microsoft.DiaSymReader.Native.amd64' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 2. The cause of the failure was: System.BadImageFormatException: Could not load file or assembly 'Microsoft.DiaSymReader.Native.amd64' or one of its dependencies. The module was expected to contain an assembly manifest.'

FUSLOGVW log of the load:

*** Assembly Binder Log Entry  (17/04/2019 @ 17:39:13) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.CLR.x86\ServiceHub.Host.CLR.x86.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/ServiceHub/Hosts/ServiceHub.Host.CLR.x86/en-US/Microsoft.ServiceHub.HostLib.resources.DLL
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/ServiceHub/Hosts/ServiceHub.Host.CLR.x86/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = ServiceHub.Host.CLR.x86.exe

Calling assembly : (Unknown).

LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.CLR.x86\ServiceHub.Host.CLR.x86.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: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/ServiceHub/Hosts/ServiceHub.Host.CLR.x86/en-US/Microsoft.ServiceHub.HostLib.resources.DLL.
LOG: All probing URLs attempted and failed.

In all honesty I'm not absolutely sure that the FUSLOGVW log relates to the exception message, but that's what the log says when VS breaks, so am working on the basis that it does but I've never used FUSLOGVW before - I found a reference to it in a related question hereabouts.

Background / what I've tried

This is with the build set for 'Any CPU'.

I've tried uninstalling and reinstalling pretty much every reference in the projects with NuGet, and repairing my VS2019 install, but am back to the same error.

I've been searching for similar problems on here and elsewhere for a couple of days now so am pretty sure there isn't a solution to this specific problem already findable.

Looking at the location in the FUSLOGVW report, the file:

"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/ServiceHub/Hosts/ServiceHub.Host.CLR.x86/en-US/Microsoft.ServiceHub.HostLib.resources.DLL"

...doesn't exist, the en-US folder it's supposed to be in doesn't exist either, that's when I tried the VS2019 repair hoping it might [re]create it.

The .config file mentioned in the log:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.CLR.x86\ServiceHub.Host.CLR.x86.exe.Config

...contains the below:


<?xml version="1.0" encoding="utf-8" ?>
    <relativeBindForResources enabled="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
           Add probing paths to Extension Manager and MS.VS.Settings assemblies.
           The probing paths are relative to the app base, and it is in VS\Common7 folder, 3 levels up from the service location.
      <probing privatePath="IDE;IDE\PrivateAssemblies;IDE\PublicAssemblies;"/>

      <!-- Redirect ServiceHub dependencies to VS versions -->
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
        <bindingRedirect oldVersion="" newVersion=""/>

Other straws I've tried clutching

I retried reinstalling Newtonsoft.Json since it was the only assembly mentioned in the .config above but I'm firmly at the clutching at straws stage now and can't really see a way to progress.

Can anyone please suggest a way forward? - thanks very much for your interest. I'm on Asia time so may not respond right away by the time you western folk wake up :)

asked on Stack Overflow Apr 18, 2019 by Chris of the Coffee • edited Apr 18, 2019 by GSerg

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0