1

I have a solution that looks like this:

Solution

  • Parent project: C++/CLI with some native C++ mixed in
  • Child project: C#, reference to the parent

The child project can reference a static class and method from the parent project and both projects compile fine.

However, when I try to run the child project, as soon as it tries to access that static method, the runtime crashes with a "FileNotFoundException":

FileNotFoundException

I did some Googling and a lot of people say that this can happen if you're building one DLL in x86 and the other in ANY CPU or x64.

But I adjusted my build configuration and I'm still getting this problem. I'll admit that I find visual studio's build configuration GUI unbelievably confusing, so here's a screenshot:

Build configuration

So... Any clues as to what I need to do to get this working?

1 Answer 1

2

Might be that the output directory of your projects are not configured correctly.

Otherwise have a look at fuslogvw.exe to diagnose the failed binding.

Sign up to request clarification or add additional context in comments.

1 Comment

To any future readers; if you're having any trouble using or finding fuslogvw (I did), check out these two stackoverflow answers too: stackoverflow.com/questions/255669/… and stackoverflow.com/questions/1674279/… ... Don't forget to run as administrator too. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.