Search code examples
c#c++c++-cli

C++/CLR: command-line error only when compiling x86


I'm building a project that uses C++/CLI to wrap a C# dll. Everything works just fine when compiled in x64. Debug & release both work on x64. When I switch to x86, however, I get the following error:

command-line error: cannot open metadata file "D:\path\to\CppWrapper\CsLibrary.dll"

...followed up with the list of "name must be a namespace" errors you would expect after a library link has failed.

I've been going around and around in the individual project settings to no success.


Solution

  • I eventually gave up and went through the csproj files one by one for every project in the solution to make sure all the build outputs were pointed the right way. I've managed to solve this issue and have moved on to the next issue.

    Who would have thought switching from x64 to x86 would be such a mess?