Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reference a C# Class Library project in Visual Studio 2010?

I am new to visual studio and was wondering how to setup visual studio 2010 so that I can reference my C# windows class library project? I currently have a solution with 2 projects - C# library project and a unit test project.

What is the best way to create multiple clients that will use this library? Should they be their own solution or just another project in the library solution? How do I use the classes in the library function from the project that references the library project?

like image 385
Ben Avatar asked Sep 30 '11 05:09

Ben


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 is reference operator in C?

The reference operator noted by ampersand ("&"), is also a unary operator in c languages that uses for assign address of the variables. It returns the pointer address of the variable. This is called "referencing" operater.

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 can add a reference to a library by doing a rightclick on the references node in the solution explorer and selecting the req. lib...

When all you consuming apps are located within the same solution I would prefer to place the lib also inside the sln, otherwise I would use an extra sln

like image 99
Thorsten Hans Avatar answered Sep 19 '22 14:09

Thorsten Hans