简体   繁体   中英

Unable to load DLL after Outlook Add-In is published

I am working on an outlook 2010 add-in where I am using the GhostScriptSharp API (gsdll32.dll) in my project and am running into an issue where the application has troubles loading the DLL after it is published.

The plug-in works perfectly fine in debug mode in visual studio, but once I publish and install the plug-in, I am getting the following exception at runtime:

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

In the dll file properties I have the build action set to "content" and the Copy to Output Directory set to "copy always". Also I have tried to place a copy of the gsdll32.dll file in the C:\\Windows\\System32 folder, but the problem still is present.

Has anyone come across this situation after publishing an app/or plug-in when using a dll? Is there something clearly wrong that I am doing?

I ended up getting this working by installing GhostScript separately along side my plug-in, instead of attempting to embed the gsdll32.dll in the plug-in. I also had to edit my windows "path" environment variable so that the GhostScriptSharp wrapper could access GhostScript.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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