开发者

Nuget - Ability to specify which package dependencies to exclude from the package being added

My problem is this:

I have an ASP.NET MVC 3 website project which references many Nuget public packages. These packages provide some additional functionality to my project but are not mandatory for the project to run. Now I've made a Nuget package myself based on this project. When I include this package in another ASP.NET MVC 3 website project all those Nuget packages referenced by my, should I say template project, are also added into the destination project.

That is something I don't really want or like. Preferably I would like the ability to choose which packages get in and which not.

I think the problem stems from the fact 开发者_C百科that Nuget treats all the package dependencies the same, while I think there should be a way to tell which package dependency is mandatory and which one is useful but optional.

Is there anything like that in Nuget (currently using the latest 1.5 version)?


The problem is in using an automating tool for creating the package. However, there's a solution and it is in NuGet Package Explorer (http://npe.codeplex.com/).
Open your package in NPE and edit package's metadata

Edit -> Edit Metadata

Near the bottom of the panel is the Dependencies section. Here you can remove any unwanted dependency you have put with your automating tool.
You may also want to see what these dependencies look like in XML - use

Edit -> Edit Metadata Source

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜