all groups > visual studio .net debugging > august 2005 >
You're in the

visual studio .net debugging

group:

DLL not found


DLL not found Ian Lazarus
8/8/2005 7:52:45 PM
visual studio .net debugging:
(Visual C++ .NET 2003)

Greetings,

When debugging an EXE which references a DLL, the DLL is not found. The DLL
is located in a directory different from the one the EXE is in. The working
directory property for the EXE project is set to the DLL directory, but the
system still says that it can't find it. The EXE code does not call
LoadLibrary(). The only way this has ever worked is if the DLL is placed in
the same directory as the EXE file, but I don't wish to do that because then
there are multiple copies of the DLL.



The same problem occurs if the DLL is debugged with the EXE specified as the
command property of the DLL project.

Thanks

Re: DLL not found Oleg Starodumov
8/9/2005 10:38:35 AM

[quoted text, click to view]

You can enable loader snaps to check what the loader thinks about working directory
and DLL search path.

HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\yourapp.exe
GlobalFlag = 0x2 (REG_DWORD)

Run the application under debugger and check messages with "LDR" prefix
in Debug Output window. One of the first messages will contain the search path,
working directory, etc., other messages can also be useful.

Regards,
Oleg
[VC++ MVP]


AddThis Social Bookmark Button