我目前有一个项目,这是由经典的asp.net web表单编写的。现在我不想把所有的项目都转换成MVC4.0。这就是为什么我要把我的项目变成混合项目。我添加了所有的mvc、路由库。
但是我不能将system.web.optimization添加到我的项目中。在自动生成的代码中,我得到了错误。
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ASP {
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Helpers;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Optimization; // the line i m getting error
using System.Web.Routing;
public class _Page_Views_Home_Contact_cshtml : System.Web.Mvc.WebViewPage<dynamic> {
public _Page_Views_Home_Contact_cshtml() {……
发布于 2013-07-17 15:07:08
它在ASP.NET MVC4中已经过时了
你可以从nuget获得你需要的东西:
Install-Package Microsoft.AspNet.Web.OptimizationSOURCE
其他帮助:
Adding the new ASP.NET Web Optimization framework to MVC4 projects after manually upgrading them
https://stackoverflow.com/questions/17693260
复制相似问题