为什么 ASP.NET MVC 4 有这么多的 NuGet 包,哪些是真正重要的? [英] Why does ASP.NET MVC 4 have so many NuGet packages and which are truly important?
问题描述
正如标题所说,为什么 ASP.NET MVC 4 项目有这么多的 NuGet 包?现在整个框架都拆分成包了吗?对于将是网站、没有 API 等的空项目,哪些是真正重要的?
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?
更新
为了澄清,我没有问题,除非您将基本的混淆视为一个问题.我只想知道为什么新的MVC 4项目默认安装了这么多包?一个空的项目有一整页的包.一个互联网项目包含三个完整页面的包.
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.
我只是好奇为什么这是因为我当前的 MVC 3 项目最多使用五个包.
I'm just curious why this is because my current MVC 3 projects use at max five packages.
推荐答案
正如标题所说,为什么 ASP.NET MVC 4 项目有这么多的 NuGet 包?
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.
对于将成为网站、没有 API 等的空项目,哪些是真正重要的?
Which ones are truly important for an empty project that will be a website, no API, etc?
这是允许您配置路由并使用呈现 Razor 视图的操作定义控制器的严格最低要求:
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>
或者如果您只喜欢页面的 1/2:
or if you prefer only 1/2 of a page:
这篇关于为什么 ASP.NET MVC 4 有这么多的 NuGet 包,哪些是真正重要的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!