简体   繁体   English

加载失败...\x86\SNI.dll

[英]Failed to load ...\x86\SNI.dll

I am trying out Entity Framework (Core).我正在尝试实体框架(核心)。 I installed the packages from NuGet and wrote a very basic program to test things out.我从 NuGet 安装了软件包,并编写了一个非常基本的程序来测试。 However, when I run it, I get System.TypeInitializationException and inside that, there is a Win32Exception - Failed to load C:\\...Documents\\x86\\SNI.dll .但是,当我运行它时,我得到System.TypeInitializationException并且在其中,有一个Win32Exception - Failed to load C:\\...Documents\\x86\\SNI.dll

The path where it's looking is wrong.它正在寻找的路径是错误的。 The Dll is inside the project folder, but for some reason it is trying to load it from my documents folder. Dll 位于项目文件夹内,但由于某种原因,它试图从我的文档文件夹中加载它。 When I copy and paste the x86 folder from where it was installed to documents, the program works.当我将 x86 文件夹从安装位置复制并粘贴到文档中时,该程序可以正常工作。 However, I would be happier if it just worked the way it should, and loaded the Dll from where it is installed.但是,如果它按应有的方式工作,并从安装位置加载 Dll,我会更高兴。

Is there any way to achieve this?有什么办法可以做到这一点?

For me it seems to be an issue with the string "C#" in the path, especially the "#" character.对我来说,路径中的字符串“C#”似乎是一个问题,尤其是“#”字符。 I was facing the same issue.我面临着同样的问题。 My path of the project was我的项目路径是

D:\Company\Projects\C#\Live\pg_change_tool_new\ D:\Company\Projects\C#\Live\pg_change_tool_new\

...and it was trying to load the DLL from this path: ...并且它试图从该路径加载 DLL:

D:\Company\Projects\x86\SNI.dll D:\公司\项目\x86\SNI.dll

After I cloned the project to a location without the string "C#" in the path name, it tried to load the DLL from the right location:在我将项目克隆到路径名中没有字符串“C#”的位置后,它尝试从正确的位置加载 DLL:

D:\Company\Projects\pg_change_tool_new\PG_Change_Tool_UI\bin\Debug\x86\SNI.dll D:\Company\Projects\pg_change_tool_new\PG_Change_Tool_UI\bin\Debug\x86\SNI.dll

...and it worked fine. ...而且效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载 SNI.dll - Failed to load SNI.dll 无法加载 DLL 'sni.dll' - Entity Framework Core - Unable to load DLL 'sni.dll' - Entity Framework Core 无法加载 DLL 'sni.dll' 或其依赖项之一:找不到指定的模块 - Unable to load DLL 'sni.dll' or one of its dependencies: The specified module could not be found 为什么我的x64位应用程序能够加载x86位DLL? - Why does my x64 bit app able to load a x86 bit DLL? x86 DLL起作用但x64 DLL不起作用 - x86 DLL Works But Not x64 DLL x64 Appdomain中的x86程序集-x86 exe可以工作,x86 dll失败 - x86 Assembly in x64 Appdomain - x86 exe works, x86 dll fails 在 x86 平台上使用 emgu cv 时无法加载 dll cvextern - unable to load dll cvextern while using emgu cv for x86 platform 使用 Microsoft.Data.SqlClient 2.0 时无法从单元测试加载 DLL 'Microsoft.Data.SqlClient.SNI.x86.dll' - Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x86.dll' from Unit Tests when using Microsoft.Data.SqlClient 2.0 无法从x64 / x86加载DLL'SQLite.Interop.dll',但能够与System.Data.SQLite.dll一起加载 - Unable to load DLL 'SQLite.Interop.dll' from x64/x86 but is able to load the one alongside System.Data.SQLite.dll 适用于x86 / x64体系结构的SQLite dll - SQLite dll for x86/x64 architectures
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM