Hello, I’m having some difficulties while trying to consume an unmanaged-code dll from my application (Written in C# framework 4.0) I’m using the dll import as follows
[DllImport(@"C:\MGW_SDK.dll", EntryPoint = "fInicializaSDK")]
public static extern int fInicializaSDK();
The weird thing is that when called from my development environment(Windows XP) it works just fine, but when on the production server (Windows7) it generates the following exception:
System.DllNotFoundException: Unable to load DLL ' C:\MGW_SDK.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Comtpaq.AdminPack.SDKWrapper.fInicializaSDK() at Comtpaq.AdminPack.AdminPaqRepository.InitializeSDK() in C:\Work\AgroIn\AdminPaqRepository.cs:line 30
I already ran Dependency Walker That shows the following dependency as conflicted:
C:\windows\system32\SHLWAPI.DLL
I already tried copying that DLL to my deployment directory
The MGW_SDK.dll is on c:\ (as the path says)
I already installed C Runtime Library
I also noticed some interesting stuff… on the exception the development path is show “C:\Work\AgroIn\AdminPaqRepository.cs:line 30”
What else can be the problem here?
I really appreciate any help with this.
Edit
OK... a little update on this issue, so i build a very little console application with just one of the extern/dllimport methods that i use from MGW_SDK.dll... and ran it with no problem (no DllNotFoundException what so ever), so this seems to be related to the application that i'm building (WCF Service...). This service is hosted on the WAS, but still i'm not able to find what the issue is... Help!
Thanks