Is System.Web.Optimization part of .Net Framework

2019-03-14 11:57发布

问题:

I've been using Microsoft.Web.Optimization package for some time via the Visual Studio 2012 trial. I was thinking that the Optimization Namespace would be part of .NET 4.5 as stated here.

However, I installed the new release of Visual Studio 2012 & .NET Framework 4.5, and now there's no System.Web.Optimization namespace by default! I had to install the package through NuGet

Is the VS 2012 Ultimate release not yet complete? Or, is the Microsoft.Web.Optimization namespace not in .NET 4.5?

回答1:

Microsoft is adopting a new strategy with VS2012 in which they are componentizing more of the new features as packages that can be downloaded via nuget. For example, Entity Framework, MVC4, WebApi, Web Optimization, etc.. are all now packages rather than part of the framework.

The reason is that these systems can now be easily upgraded out of cycle with the rest of the framework. Thus, MVC5 can be easily released without waiting for .NET 5, and Web Optimization v2 can be released whenever it might be ready.



回答2:

Here is a similar question:

  • How to add reference to System.Web.Optimization for MVC-3-converted-to-4 app

Microsoft.Web.Optimization package is now "legacy":

  • Microsoft.Web.Optimization 1.0.0-beta2

The new package is Microsoft.AspNet.Web.Optimization:

  • Microsoft ASP.NET Web Optimization Framework 1.0.0

Microsoft.AspNet.Web.Optimization and Microsoft.Web.Optimization are NOT part of .NET Framework 4.5.

  • .NET Framework 4.5 Class Library