Question

Can anyone share with me how to (or where I can find how to) install NuGet packages automatically when I create a new project based on my custom project template in Visual Studio 2010?

I am creating a new project template for a project that uses a couple NuGet packages by default. I've read the documentation on the NuGet site but this is not acceptable in that I want to reference an existing package if it's already installed in the project.

In other words, if I embed package v1 in my template (VSIX) but version 1.1 has already been installed in the solution, I want NuGet to reference version 1.1 instead of putting v1 into the solution and forcing the developer to update the package.

Is this possible? And, if so, how?

Était-ce utile?

La solution

NuGet 1.5 now supports this feature without requiring that you build an ASP.NET MVC 3 project template.

http://blogs.msdn.com/b/marcinon/archive/2011/07/08/project-templates-and-preinstalled-nuget-packages.aspx

This supersedes the post that I wrote. :)

Autres conseils

Check out this post here:

http://haacked.com/archive/2011/06/06/creating-a-custom-asp-net-mvc-project-template.aspx

The article mentioned that the NuGet packages need to be on your machine, however this should change in the future (if it hasn't already).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top