|Shared Project Type|
Prior to Visual Studio 2015, if a file needed to be shared between multiple projects within a solution, developers could use Add As Link when adding the file to a project. This method adds a file reference to the project which may be located in any arbitrary path. The file is not copied, and the original file path is used during compilation. In this way, it is possible to define multiple projects, each with their own build configuration, which individually reference a common set of code files.
|Add As Link|
Add As Link is an effective way to share code, but because it must be maintained per-project it can be painfully tedious. In the case of a large solution with many files and many build targets, this prospect can be daunting.
Shared Projects to the Rescue
|Add Shared Project Reference|
Rather than maintaining links to every code file in each project, developers can define a single Shared Project with the file structure as they desire, and add it to each compiled project as a special type of reference. Compiled projects can define their own assembly references and/or NuGet packages and any other specific build configurations without worrying about the structure of the code in the referenced Shared Project. No more links.
|Configuring Target Projects|
This trick of course works for unit test projects, too. Create another Shared Project containing your tests and reference that as well as the relevant project (not the Shared Project) for each framework or platform target.
|Configuring Unit Test Projects|