Dll is missing right after publishing it. .net WinForms


Where the files of published project will go after installing it ? I tried putting the DLL inside of the setup folder there yet it has still a same problem.

I'm trying to use the DLL using pinvoke

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

I receive this error:

Unable to load DLL 'tc-b_new_sdk.dll': The specified module could not be found. 
(Exception from HRESULT: 0x8007007E)
asked on Stack Overflow Nov 7, 2019 by bpoom za • edited Nov 7, 2019 by David Heffernan

2 Answers


Try adding Path of your DLL like this :

[DllImport("C:\Users\User\Desktop\tc-b_new_sdk.dll", CallingConvention = CallingConvention.Cdecl)]
answered on Stack Overflow Nov 14, 2019 by Bap mop

Either the DLL itself, or one of its dependencies cannot be found.

If the DLL is in the same directory as the executable, this points to the issue being the dependencies. We can't know what the dependencies are. That information should have been supplied with the 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.

answered on Stack Overflow Nov 7, 2019 by David Heffernan

User contributions licensed under CC BY-SA 3.0