How to reference a secondary project in Visual Studio 2010

I have project A, a C # console application that I want to reference my project B, a C # class library. My goal is to be able to use the objects in project B as part of project A and see the source tree for both projects in the same solution explorer. I can, of course, make a link from Project A. to the constructed DLL that exits Project B and use the objects in this way, but this does not give me the control that I would like.

I find it difficult to achieve this. I assume that it should be found in the "Add Link" → "Project" tab, but I do not see any elements in this tab window and cannot figure out how to fill it. Am I missing something? Both projects are targeting the .NET 4.0 platform, and I am using Microsoft Visual Studio 2010 Version 10.0.40219.1 C # Express with Service Pack 1 Service Pack 1 (KB983509).

Any help would be appreciated, thanks.

+4
source share
2 answers

Open Project A, File> Add> Existing Project

Both projects should be in one solution.

+5
source
  • Open Project A
  • File - Add - Existing Project
  • Open the .csproj file for Project B

You should now see the source for both projects as part of the same solution.

Now from project A:

  • Add link
  • Go to the Projects tab
  • Select Project B

Project A will now use the types declared in project B.

+11
source

Source: https://habr.com/ru/post/1402166/


All Articles