Trying to load a .NET dll

M

Mike Kamzyuk

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.
 
M

Mattias Sjögren

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
 
M

Mike Kamzyuk

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top