How can I deploy an unmanaged DLL using a click-once WPF application?

I have a one-time WPF application that uses an unmanaged dll.

When debugging locally, I just copied the dll to the debug / bin folder.

How to include a DLL in a project (VS2010) so that it is deployed and accessible for the application?

I tried to add it as a resource and install “Content” and “Always Copy”, and the file seems to be present in the installation / deployment files, however the application cannot see it.

If this helps, this is an example of the code that I use to access methods in an unmanaged DLL.

[DllImport("ODBC_VER_DETECT.dll")] extern private static long GetCompanyFileVersion([MarshalAs(UnmanagedType.LPStr)] String sDataBase, [MarshalAs(UnmanagedType.LPStr)] StringBuilder sVersion); 
+6
source share
1 answer

Instead of going through the entire "Add Resource" rigmarole - I just had to "Add an existing item" to the root folder of the project, and then install "Content" and "Copy always."

+8
source

Source: https://habr.com/ru/post/889357/


All Articles