Dafydd Giddins
Dafydd Giddins

Reputation: 2316

How do you reference a C# project from a C++/CLi project in same solution

I have two projects in a solution, one is a C# library and the other is a C++/CLI library.

I have added a reference in the C++/CLI project using the references menu to the c# library. I then add the

#using <assembly.name.dll>

and try to reference the assembly with

using namespace namspace.subnamespace;

But i get the error that the assembly.name.dll cannot be found. I have tried matching the case and all lower case for the assembly name but to not avail. Amazingly there is not reference anywhere on the internet about how to reference assemblies you have created yourself.

What is the correct was to do this and if i'm doing it right, what course should i take to diagnose this.

Upvotes: 14

Views: 8082

Answers (2)

Juozas Kontvainis
Juozas Kontvainis

Reputation: 9597

You need to add path to your C# assembly to C/C++ > General > Resolve #using References

Upvotes: 12

leppie
leppie

Reputation: 117240

I dont think you need the #using bit if you included a reference.

Upvotes: 7

Related Questions