在C# ASP.Net Framework应用程序中加载libzstd.dll

3

我将Mongo驱动程序从2.7.3版本升级到最新的2.15.0版本,应用于ASP.NET Framework(4.8)应用程序中。我只是使用VS升级了NuGet软件包,没有进行其他操作,但当我运行时出现以下错误:

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.

我不确定我在这里缺少哪些步骤。


你的机器上安装了Net 4.0吗(C:\Windows\Microsoft.NET\Framework\v4.0.30319)?Net 4.8是累积的,不需要安装旧版本的Net。你可能需要修改框架版本,以使用Net 4.8配置而不是4.0。 - jdweng
@jdweng 是的,那个目录确实存在,并且里面有很多东西。这是我系统上唯一存在的v4目录。 - Tanktalus
Net 4.0已安装吗?文件夹可能存在,但如果软件未安装,则无法正常工作。请检查已安装的软件列表:控制面板\程序\程序和功能。检查Microsoft Net是否存在。 - jdweng
这个项目是16/32/64位的项目。dll文件可能在bin文件夹中的错误位置。请参考以下链接:https://dev59.com/aWox5IYBdhLWcg3wvWwy?force_isolation=true - jdweng
这里遇到了完全相同的问题。你有什么运气吗? - Anderson Pimentel
显示剩余6条评论
1个回答

0

libzstd.dll 似乎是 Mongo 驱动程序的非托管库之一。

据我所知,可以安全地忽略该错误。这只是因为 DLL 存在于 bin 文件夹中,.NET 尝试自动加载它而引发的。

对于已弃用的 Crc32C.NETSnappy.NET 包,情况也是如此。它们是旧版本 MongoDB 驱动程序的依赖项,现在可以安全地删除。


1
很遗憾,此后该应用程序无法启动,这意味着忽略不可行。 - Tanktalus
@Tanktalus你有没有找到解决这个问题的办法? - undefined
@TylerForsythe 到目前为止,我的解决方案是“回退升级”,我会在能够将应用程序从. NET Framework 转换为. NET 6+ 时再次尝试。 - undefined
我最终做了两件事情:我将我的NuGet引用升级到了MongoDB,并发现构建过程没有将所有必要的DLL文件复制到bin目录中。这暂时解决了我的问题,尽管对于未复制的DLL文件,我们仍在寻找更持久的解决方案。 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接