This is a simple post that shows how to add reference to projects in Visual Studio.
Project 1: Run Visual Studio and choose File>New Project>Console Application
Project 2: This time from the Solution Explorer choose Add>New Project
In the appearing dialog, choose Class Library
Now in the solution explorer, you can see two projects as shown below.
Now we have to refer the ClassLibrary1 project in the ConsoleApplication1.
For this, right click on the References item under ConsoleApplication1 and choose Add Reference.
The following dialog will appear.
The first tab .NET refers to .Net libraries you can refer to. They will be residing in the GAC (Global Assembly Cache)
The COM tab refers to the registered COM servers in your machine.
The Projects tab refers to your
existing projects in the solution. It will not show the project from
where Add Reference is invoked.
The Browse tab helps us to locate the library by exploring through your machine folders.
The Recent tab remembers your recently added references. It is easier to locate them.
Our tab of interest is Projects tab.
Click on the Projects tab and you will be able to see the
ClassLibrary1. Select it and click Ok.
That completes adding the reference.
From the ConsoleApplication1, you can select the Program.cs and type the following.
static void Main(string args)
ClassLibrary1.Class1 class1 = new ClassLibrary1.Class1();
If you can build the entire thing, you are done successfully.