Reputation: 9480
As the title says, why do the ASP.NET MVC 4 projects have soooo many NuGet packages? Is the entire framework split into packages now? Which ones are truly important for an empty project that will be a website, no API, etc?
UPDATE
To clarify, I'm not having issue, well, unless you count basic confusion as one. I just want to know why new MVC 4 projects have so many packages installed by default? An empty project has one full page of packages. An internet project has three full pages of packages.
I'm just curious why this is because my current MVC 3 projects use at max five packages.
Upvotes: 38
Views: 13147
Reputation: 53115
ASP.NET MVC has been increasingly delivered via NuGet packages since ASP.NET MVC 3 Tools Update. This offers several advantages:
You'll notice that in a project from the Basic template, you'll get the following packages:
Five of the nine are used for Web Api, which has been highly componentized to allow developers a lot of flexibility about where and how they can use them. If you want to minimize your NuGet packages, you can use the Basic template.
As you move up into the Basic and Internet templates, you'll see more packages to support the additional features the projects provide. Internet brings in several packages of open-source, non-Microsoft code such as OAuth and JavaScript libraries.
There are a lot of JavaScript packages, which is a really good thing when you think about it, since this means that NuGet is automatically handling JavaScript dependencies for you - if you want to upgrade jQueryUI which in turn requires a new version of jQuery, it'll automatically upgrade jQuery for you.
Upvotes: 22
Reputation: 1038730
As the title says, why do the ASP.NET MVC 4 projects have soooo many NuGet packages?
That's a question you need to ask the designers of the framework.
Which ones are truly important for an empty project that will be a website, no API, etc?
Here's the strict minimum that will allow you to configure routing and define a controller with an action rendering a Razor view:
<packages>
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net40" />
<package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net40" />
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
</packages>
or if you prefer only 1/2 of a page:
Upvotes: 26