为什么 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 项目默认安装了这么多包?一个空项目包含一整页的包.一个 Internet 项目包含三页完整的包.
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屋!