1
votes

The big picture: what I am trying to accomplish is writing code in both C# and C++, to strike a good performance/productivity balance. It is not for code reuse reasons; I just want to be able to write new code in native C++ when it suits me, without committing to all its horrors.

I have a solution with 4 projects:

  • GUI: C# WPF interface
  • Logic_Cs: C# DLL, high level reference implementation of game logic
  • Logic_CLI: CLI DLL, interface between managed and unmanaged code
  • Logic_Cpp: C++ lib with native implementation

At some point, all of this was working just fine. In my GUI project I could switch between C#/C++ implementation merely by using the namespace from the appropriate DLL.

Then I apparently changed something, and now I can not get the namespace in the Logic_CLI project to be recognized in the GUI project, even though the Logic_Cs namespace still works just fine.

Yes, I added correct references, set dependencies, rebuilt AND recreated my entire solution structure from scratch; nothing helps.

I notice the C# DLL builds to a folder in its own project directory, while CLI builds to the solution directory; but the GUI application seems to look for the DLL's in their correct directory anyway, and im not getting any complaints about the DLL; it just refuses to import the namespace from it.

Earlier, when all this was working, I wasnt explicitly exporting anything from the CLI DLL; nor am I doing so for the C# DLL. It should 'just work', no?

Right click the reference, View in Object Browser.Hans Passant
Its in the object browser. But the issue has been resolved. Rebuilding my project line by line, I discovered the problem was the duplicate definition of a compiler symbol; thank you C++ for feeding me back with such relevant error messages (yes, that is sarcasm; infact the C++ part compiled just fine)Eelco Hoogendoorn
Do you mind sharing what the symbol was? I seem to have the exact same problem (no complaints from VS, other than the "type or namespace name... could not be found", Object Browser works).Kohanz