我目前正在开发一个由经典的asp.net网页表单编写的项目。现在我不想将所有项目转换为mvc 4.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() {
...
答案 0 :(得分:3)
它在ASP.NET MVC 4中已经过时了
你可以从nuget获得你需要的东西:
Install-Package Microsoft.AspNet.Web.Optimization
其他帮助:
Adding the new ASP.NET Web Optimization framework to MVC4 projects after manually upgrading them