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

visual studio .net debugging

group:

dllnotfoundexception in systems without vs2005


dllnotfoundexception in systems without vs2005 eduwushu
8/31/2006 6:43:02 AM
visual studio .net debugging: Hi i have a big problem.
I have developed an application in C# in vs2005 and i built the release
version of it. The problem is that when i try to execute it in systems
without vs2005 it throws me a dllnotfound exception and i dont know which dll
is referring to. I have supposed that when you build a project in release
mode all dependencies with vs2005 are deleted in order to make your
application self-standing. Can someone tell me where is the mistake i made????
Re: dllnotfoundexception in systems without vs2005 Oleg Starodumov
9/1/2006 12:00:00 AM

[quoted text, click to view]

This exception is usually thrown when the application tries to use a DLL
via PInvoke, and cannot find the DLL on the search path (or one of the DLL's
dependencies).

Does your application use PInvoke? Is call stack available when the exception
is reported? (It can tell you the place where the exception occurs).

Oleg






Re: dllnotfoundexception in systems without vs2005 eduwushu
9/1/2006 3:34:02 AM
Hi Oleg, you are being an unvaluable help, really. Many thanks.
That's no t the problem. I use PInvoke but the application can find them. I
can't see the stack because the exception is thrown only when i execute my
application in systems witrhout visual studio 2005 or without the .net
framework v20 SDK (so i havent a debugger on which i can see the stack or
the details of the dllnotfoundexception being thrown). If one of them is
installed the exception isn't thrown. So it must be a dll which is installed
along with this environments.
My project uses only two dll's: one named WPcapProxy written in C++ as a DLL
project in the same solution as my C# application. The other DLL used by my
application is Packet.dll (a dll of the WinPcap API) but it is not invoked
directly from my C# application. WPcapProxy.dll is the one which uses
Packet.dll and my C# application does pinvoking of the methods of the first
one.
The lost dll must be a dll installed along with vs2005 (i have tried to
execute my application in systems with vs2003 and the exception is also
thrown) or the framework 2.0 SDK.

Can you guess why my project depends on a dll i havent told it to depend on??

Thanks

[quoted text, click to view]
Re: dllnotfoundexception in systems without vs2005 Oleg Starodumov
9/1/2006 3:44:21 PM
[quoted text, click to view]

Try to use Depends tool on the target system to determine what dependencies
are missing. Depends is included with Visual Studio, or can be found here:
http://www.dependencywalker.com/

It might be that the DLL(s) depend on VC runtime DLLs that are not available
on the target system. If that's the case, you can either link the DLLs with static
runtime libraries (change /MD compiler option to /MT), or distribute the libraries
as described here:
http://msdn2.microsoft.com/en-us/library/ms235299.aspx

Oleg





AddThis Social Bookmark Button