3

I'm upgrading the mongo driver to an ASPNet Framework (4.8) application from 2.7.3 to the latest, 2.15.0. I just use VS to upgrade the nuget packages, nothing else, and when I run it, I get:

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\IIS Express\iisexpress.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\git\***\bin\libzstd.dll
LOG: Appbase = file:///C:/git/***/
LOG: Initial PrivatePath = C:\git\***\bin
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:\git\***\web.config
LOG: Using host configuration file: C:\Users\***\Documents\IISExpress\config\aspnet.config
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:/git/***/bin/libzstd.dll.
ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated.

I'm not sure what step(s) I'm missing here.

Tanktalus
  • 21,664
  • 5
  • 41
  • 68
  • Do you have Net 4.0 installed on machine (C:\Windows\Microsoft.NET\Framework\v4.0.30319)? Net 4.8 is cumulative and does not require older versions of Net to be installed. You probably need to modify the Framework version to use the Net 4.8 config instead of 4.0 – jdweng Mar 22 '22 at 15:31
  • @jdweng Yes, that directory does exist and has lots of stuff in there. It's the only v4 directory that is present on my system. – Tanktalus Mar 22 '22 at 22:45
  • Is Net 4.0 installed? The folder can exist but if the software is not installed it won't work. Check Installed Software L Control Panel\Programs\Programs and Features. Check for Microsoft Net – jdweng Mar 23 '22 at 06:47
  • Net 4.0 also requires Net 1.0, Net 2.0, Net 3.0, and Net 3.5 installed. Net 4.0 is cumulative and only contain libraries that changed from previous versions of Net. – jdweng Mar 23 '22 at 08:51
  • Windows won't let me install 4.0 separately since it "is already a part of this operating system" and "[s]ame or higher version of .NET Framework 4 has already been installed on this computer." So I think I can assume that the 4.8 installation includes 1, 2, 3, 3.5, and 4.0 as required? – Tanktalus Mar 23 '22 at 14:25
  • Version v4.0.30319 is Net 4.0. So code is looking for Net 4.0. If you use Net 4.8 you only need one version of Net installed. If you are using Net 4.8 and getting error then some of the intermediate obj files are not getting compiled. Then you need to do a clean build to force all obj to get recompiled. – jdweng Mar 23 '22 at 14:37
  • Manually removed */bin and */obj, rerun (thus recompile) and still same error. Note that this libzstd.dll is pre-compiled and is part of the mongodb driver, I don't have its source, so it's not going to be recompiled. – Tanktalus Mar 23 '22 at 14:47
  • Is project a 16/32/64 project. The dll may be in wrong folder in bin. See following : https://stackoverflow.com/questions/9003072/unable-to-load-dll-module-could-not-be-found-hresult-0x8007007e?force_isolation=true – jdweng Mar 23 '22 at 15:08
  • Exact same problem here. Did you have any luck? – Anderson Pimentel Apr 29 '22 at 19:50
  • Unfortunately, no. I've had to revert the entire upgrade for now, and hopefully can put it off until we can transition from NETFramework to NET6, and hopefully that will work. – Tanktalus Apr 29 '22 at 21:59
  • Thanks for the reply. I'll generate a minimum reproducible example and open a bug report. – Anderson Pimentel Apr 29 '22 at 22:58

1 Answers1

0

libzstd.dll seems to an unmanaged library that's part of the the Mongo Driver.

As far as I could check, the error can be safely ignored. It's just thrown because the DLL it's in the bin folder and .NET tries to load it automatically.

The same occured for the deprecated Crc32C.NET and Snappy.NET packages, that was dependencies for older versions of the MongoDB Drivers and now can be safely removed.

Anderson Pimentel
  • 5,086
  • 2
  • 32
  • 54