I am having a similar issue as others with unmanaged c++ dll’s called from managed c# application however I have not been able to find a viable solution. I have included my 3rd party unmanaged dll’s in the project and Publish clickOnce included them in the same directory.
I compiled my c# project as 32 bit. The release build runs on my development system and other systems with visual studio 2012.
[DllImport(@"controller.DLL", CallingConvention = CallingConvention.Cdecl)]
public static extern int XR2_hexCmnd(int xr2Hex_command);
When run on other pc’s without visual studio 2012 I get the following error: System.DllNotFoundException: Unable to load DLL 'controller.DLL': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I get the same error using publish with clickOnce.
I have a demo version of InstallShield. When I run InstallShield it works on any PC’s. If I uninstall the program, clickOnce works (where it did not work before using installShield). When creating InstalShield installer it finds that there is a dependency of MSVCR110.dll (I included this dll in the project dir created with publish and it still does not work until InstallShield is run).
Dependency Walker does not seem to work for this project. It reports that there are many dll’s missing even on PC’s where it is working. I included all the missing dll’s and the application still does not work until using installShield.
Unfortunately InstallShield is not an option, as the application is to be incorporated into larger application.