Can't find PInvoke DLL exception

This is a discussion on Can't find PInvoke DLL exception within the DOTNET forums in Framework and Interface Programming category; My WM5 C# application was working with a native DLL I created. Then I needed to change the name of the DLL. Everything compiled properly, but when I try to run my app with the renamed DLL, there is a "Can't find PInvoke DLL" exception with no further information. I've followed the steps to enable interop logging( http://blogs.msdn.com/stevenpr/ archive/2005/06/22/431612.aspx), but no file is created. I've even tried generating a new project and copying the functions to the new project with the same result. Does anyone have any ideas on what I could be overlooking? Thanks!...

Go Back   Application Development Forum > Framework and Interface Programming > DOTNET

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-04-2008, 05:23 PM
Lcubed
Guest
 
Default Can't find PInvoke DLL exception

My WM5 C# application was working with a native DLL I created. Then I
needed to change the name of the DLL. Everything compiled properly,
but when I try to run my app with the renamed DLL, there is a "Can't
find PInvoke DLL" exception with no further information. I've followed
the steps to enable interop logging(http://blogs.msdn.com/stevenpr/
archive/2005/06/22/431612.aspx), but no file is created.

I've even tried generating a new project and copying the functions to
the new project with the same result.

Does anyone have any ideas on what I could be overlooking?

Thanks!
Reply With Quote
  #2  
Old 09-07-2008, 12:53 AM
DrewCE
Guest
 
Default Re: Can't find PInvoke DLL exception

Make sure the DLL is in the search path - same folder as your executable, or
in the Windows folder, etc.

You can also get this error when one of the dependencies of the target DLL
can't be found.

-Drew


"Lcubed" <Loris.Emailbox@gmail.com> wrote in message
news:161c127c-5833-460c-8141-ec700eee41f7@f36g2000hsa.googlegroups.com...
> My WM5 C# application was working with a native DLL I created. Then I
> needed to change the name of the DLL. Everything compiled properly,
> but when I try to run my app with the renamed DLL, there is a "Can't
> find PInvoke DLL" exception with no further information. I've followed
> the steps to enable interop logging(http://blogs.msdn.com/stevenpr/
> archive/2005/06/22/431612.aspx), but no file is created.
>
> I've even tried generating a new project and copying the functions to
> the new project with the same result.
>
> Does anyone have any ideas on what I could be overlooking?
>
> Thanks!


Reply With Quote
  #3  
Old 09-07-2008, 12:53 AM
DrewCE
Guest
 
Default Re: Can't find PInvoke DLL exception

Make sure the DLL is in the search path - same folder as your executable, or
in the Windows folder, etc.

You can also get this error when one of the dependencies of the target DLL
can't be found.

-Drew


"Lcubed" <Loris.Emailbox@gmail.com> wrote in message
news:161c127c-5833-460c-8141-ec700eee41f7@f36g2000hsa.googlegroups.com...
> My WM5 C# application was working with a native DLL I created. Then I
> needed to change the name of the DLL. Everything compiled properly,
> but when I try to run my app with the renamed DLL, there is a "Can't
> find PInvoke DLL" exception with no further information. I've followed
> the steps to enable interop logging(http://blogs.msdn.com/stevenpr/
> archive/2005/06/22/431612.aspx), but no file is created.
>
> I've even tried generating a new project and copying the functions to
> the new project with the same result.
>
> Does anyone have any ideas on what I could be overlooking?
>
> Thanks!


Reply With Quote
  #4  
Old 09-08-2008, 09:01 AM
Lcubed
Guest
 
Default Re: Can't find PInvoke DLL exception

Hi Drew,

Thanks for the input! My DLL is in the same directory as my executable
and the new DLL does not have any dependencies that the old one didn't
have. I only changed the name of the DLL. Is there any sort of
registration process that must be done in WM5?

Thanks!
Lcubed
Reply With Quote
  #5  
Old 09-08-2008, 09:01 AM
Lcubed
Guest
 
Default Re: Can't find PInvoke DLL exception

Hi Drew,

Thanks for the input! My DLL is in the same directory as my executable
and the new DLL does not have any dependencies that the old one didn't
have. I only changed the name of the DLL. Is there any sort of
registration process that must be done in WM5?

Thanks!
Lcubed
Reply With Quote
  #6  
Old 09-08-2008, 09:57 AM
Lcubed
Guest
 
Default Re: Can't find PInvoke DLL exception

Hi Drew,

Thanks for the input! I did end up finding one dependent DLL that the
target DLL was not finding even though both the target DLL and the
dependent DLL are in the same directory as the executable. I'm still
not sure why the dependant DLL cannot be found as neither it nor the
code calling it changed.

Thanks!
Lcubed
Reply With Quote
  #7  
Old 09-08-2008, 09:57 AM
Lcubed
Guest
 
Default Re: Can't find PInvoke DLL exception

Hi Drew,

Thanks for the input! I did end up finding one dependent DLL that the
target DLL was not finding even though both the target DLL and the
dependent DLL are in the same directory as the executable. I'm still
not sure why the dependant DLL cannot be found as neither it nor the
code calling it changed.

Thanks!
Lcubed
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:36 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.