I have a WPF click-once application that makes use of an unmanaged dll.
When debugging locally I have just copied the dll into the debug/bin folder.
How can I include the dll in the project (VS2010) so it is deployed and accessible to the application?
I have tried adding it as a Resource and setting "Content" and "Copy Always", and the file does seem to be present in the setup/deployment files, however the application is not able to see it.
If it helps, this is an example of the code I use to access the methods in the unmanaged DLL.
[DllImport("ODBC_VER_DETECT.dll")]
extern private static long GetCompanyFileVersion([MarshalAs(UnmanagedType.LPStr)] String sDataBase,
[MarshalAs(UnmanagedType.LPStr)] StringBuilder sVersion);
Rather than going through the whole "Add Resource" rigmarole - I just needed to "Add existing item" into the root folder of the project and then set "Content" and "Copy Always".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With