Csaba Toth
Csaba Toth

Reputation: 10697

How to manage own nuget package per project in the solution

We want to package some third party assemblies into our own nuget package. I created some packages with NuGet Package Explorer, and published it to our nuget server. I can also install it into our solution, however I have two problems:

  1. Minor problem: when I install our nuget package a .nuget directory created with a packages.config in it. This contain a reference only to the package I added. We already have however several nuget packages installed into our solution. Every packages is in the packages subfolder in it's own subfolder, plus there's a repositories.config in the packages folder. The repositories config points to other packages.config, but not the one which is created by my actions into the .nuget folder. This is true even if I try to install the nuget package using the console into a specific project!
  2. Major problem: When I look up the installed packages in the "Manage NuGet packages for the Solution...", I only see an "Uninstall" button for my package. I expect and want to have a Manage button, same what we have for the other nuget packages, which allows to check/uncheck the package per project in a treeview.

I use latest VS 2012, latest NuGet (2.2.xxx).

Upvotes: 2

Views: 963

Answers (1)

Csaba Toth
Csaba Toth

Reputation: 10697

The problem was caused by incorrect package creation. When you create your package (with NuGet Package Explorer), on the right big "Package Contents" pane you want to create a lib folder by right click and selecting "Add Lib Folder" from the context menu. Then you want to add your assemblies into this folder instead of the root of the package content. Having the right package structure helped achieving the expected behavior: no .nuget folder is created any more and I can "Manage" my package also.

Upvotes: 1

Related Questions