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?

Xenoprimate
  • 7,691
  • 15
  • 58
  • 95

1 Answers1

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.

TOS
  • 350
  • 3
  • 7
  • 1
    To any future readers; if you're having any trouble using or finding fuslogvw (I did), check out these two stackoverflow answers too: http://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net and http://stackoverflow.com/questions/1674279/cant-locate-fuslogvw-exe-on-my-machine ... Don't forget to run as administrator too. :) – Xenoprimate Jul 27 '13 at 20:46