DLLNotFoundException in C# runtime

xewoox
xewoox used Ask the Experts™
on
I got a DLLNotFound Exception when I ran my C# program, the DLL is n the \Windows\System32\

and I have wrapper functions being used.  Is there other configuration i need to be do to access functions withing the dll.

using System.Runtime.InteropServices;
 
namespace TS_GlobalVariables
{
    public class TS
    {
        [DllImport("GlobalVariable.dll", EntryPoint = "GV_SetInteger")]
        public static extern int GV_SetInteger(int iLocation, int iVal);

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
For standard "C" DLLs, the search path is all that's required. It should work. Do you think that DLL uses another DLL that's not being found?

What I'd do is use the trusty SysInternals Process Monitor to find out which DLL is not found. This should make short work of the problem.

Here's a similar discussion:

http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_21625157.html

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial