简体   繁体   English

Dll 在发布后立即丢失。 .net WinForms

[英]Dll is missing right after publishing it. .net WinForms

Where the files of published project will go after installing it?安装后已发布项目的文件将在哪里 go ? I tried putting the DLL inside of the setup folder there yet it has still a same problem.我尝试将 DLL 放在安装文件夹中,但仍然存在同样的问题。

I'm trying to use the DLL using pinvoke我正在尝试使用 pinvoke 使用 DLL

[DllImport("tc-b_new_sdk.dll", CallingConvention = CallingConvention.Cdecl)]

I receive this error:我收到此错误:

System.DllNotFoundException: 
Unable to load DLL 'tc-b_new_sdk.dll': The specified module could not be found. 
(Exception from HRESULT: 0x8007007E)

Try adding Path of your DLL like this:尝试像这样添加 DLL 的路径:

[DllImport("C:\Users\User\Desktop\tc-b_new_sdk.dll", CallingConvention = CallingConvention.Cdecl)]

Either the DLL itself, or one of its dependencies cannot be found.找不到 DLL 本身或其依赖项之一。

If the DLL is in the same directory as the executable, this points to the issue being the dependencies.如果 DLL 与可执行文件位于同一目录中,则表明存在依赖关系的问题。 We can't know what the dependencies are.我们无法知道依赖关系是什么。 That information should have been supplied with the DLL.该信息应该与 DLL 一起提供。 A common cause of this error is that your program isn't able to resolve a dependency on the MSVC to which the DLL is linked.此错误的常见原因是您的程序无法解决与 DLL 链接到的 MSVC 的依赖关系。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM