I am experiencing the following problem.

I have a c++.NET dll in some directory. Let's call it ABC.dll.
Now, I try to create a c# project and add this dll to it.
So I add it as a reference.

The project builds.
When I run it, however, I get a FileNotFound exception.
File or assembly name ABC (mind you without the .dll), or one of its
dependencies, was not found.

Even more interesting, I have another app which uses this dll without
any problems, though I am not running it right now.

Re: Trying to load a .NET dll by Mattias

Mattias
Thu Mar 24 15:35:36 CST 2005

>So I add it as a reference.
>
>The project builds.
>When I run it, however, I get a FileNotFound exception.
>File or assembly name ABC (mind you without the .dll), or one of its
>dependencies, was not found.

Have you set CopyLocal=true for the reference?



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Re: Trying to load a .NET dll by Mike

Mike
Wed Mar 30 15:50:39 CST 2005

Yes. That didn't work. I solved the problem though. It turns out
that the dlls on which that dll depended were not automatically copied.
So I just had to copy those too. At least they put in a pre-build
event :)


Mattias Sj=F6gren wrote:
> >So I add it as a reference.
> >
> >The project builds.
> >When I run it, however, I get a FileNotFound exception.
> >File or assembly name ABC (mind you without the .dll), or one of its
> >dependencies, was not found.
>
> Have you set CopyLocal=3Dtrue for the reference?
>
>
>
> Mattias
>
> --
> Mattias Sj=F6gren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.