Search code examples
visual-studiomonodevelopshared-project

How to add references and packages to a shproj or shared project in a visual studio solution?


I have a visual studio solution with a shared project and a number of projects that depend on it. The shared project is essentially the "bulk" of the entire solution, and the csprojs are basically "extensions" of the shared project. It looks something like this.

  • sln file
    • shproj that depends on some packages and libraries
    • csproj1 that depends on shproj and must therefore import the shproj dependecies
    • csproj2 that depends on shproj and must therefore import the shproj dependecies
    • ...
    • csprojN that depends on shproj and must therefore import the shproj dependecies

As you can see, this is not ideal. If I wanted to make the shared project dependent on another package, I have to add it to ALL csproj projects.

Is there any way to add the packages to the shared project directly? Using Monodevelop if possible. If not, is there some other solution to the problem of code reusage that would work better in this case than a shared project?


Solution

  • Shared Projects cannot reference any other project type (including other Shared Projects).

    From MSDN