locked
Install Nuget packages so they are available to all projects in a solution? RRS feed

  • Question

  • User-734459410 posted

    So I'm working with an N-Tier design, where i have a data model, DAL, a logic layer, and other projects that make up the application.

    Currently, I have to go through an install EntityFramework on the projects that need it, which I'm concerned about redundancy.  

    First question: is this a true concern (redundancy of Nuget packages within a solution)?

    Second, if it is, is there a way to install Nuget packages at the solution level so they are available to all projects in the solution?

    (In most of my solutions, all projects within the solution target the same .net framework version and processor architecture, usually 32-bit for now as I'm working with some legacy systems.  If there was a way to condense all Nuget packages into one location for the solution would make updating them and maintaining packages easier in my opinion.)

    Thursday, January 11, 2018 4:04 AM

All replies

  • User475983607 posted

    Currently, I have to go through an install EntityFramework on the projects that need it, which I'm concerned about redundancy.  

    First question: is this a true concern (redundancy of Nuget packages within a solution)?

    Installing EF in multiple projects within a solution could be a read flag as EF is data access.  However, it is common for projects to share assemblies.  

    Second, if it is, is there a way to install Nuget packages at the solution level so they are available to all projects in the solution?

    Yes, just right click the solution and select "Manage NuGet packages for the Solution".  Or click the "Tools" file menu and select the same.

    (In most of my solutions, all projects within the solution target the same .net framework version and processor architecture, usually 32-bit for now as I'm working with some legacy systems.  If there was a way to condense all Nuget packages into one location for the solution would make updating them and maintaining packages easier in my opinion.)

    The NuGet packages are located in the "packages" folder.

    Thursday, January 11, 2018 8:08 PM
  • User-1838255255 posted

    Hi cbassett,

    According to your description, I agree with mgebhard's reply, i want to make some addition of these question, i found some tutorials about how to implement it, please check:

    Make entity framework available in all projects: 

    https://stackoverflow.com/questions/39373106/make-entity-framework-available-in-all-projects 

    Create an Entity Framework Model and Use it in Multiple Projects: 

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=617 

    Best Regards,

    Eric Du 

    Friday, January 12, 2018 10:07 AM