Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 981
Dafydd Giddins Avatar asked Apr 03 '09 10:04

Dafydd Giddins


People also ask

How do you declare a reference in C?

References in C++ A variable can be declared as a reference by putting '&' in the declaration.

Does C have a reference operator?

No, it doesn't. It has pointers, but they're not quite the same thing. For more details about the differences between pointers and references, see this SO question.

What does reference mean C?

The call by reference method of passing arguments to a function copies the address of an argument into the formal parameter. Inside the function, the address is used to access the actual argument used in the call. It means the changes made to the parameter affect the passed argument.

Do we have reference variable in C?

Master C and Embedded C Programming- Learn as you goReference variable is an alternate name of already existing variable. It cannot be changed to refer another variable and should be initialized at the time of declaration and cannot be NULL. The operator '&' is used to declare reference variable.


1 Answers

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

like image 176
Juozas Kontvainis Avatar answered Sep 22 '22 20:09

Juozas Kontvainis