brtb
brtb

Reputation: 2311

cannot add system.web.optimization

I m currently having a project which was written by classical asp.net web forms. Now i do not want to convert all the project to mvc 4.0. thats why i m trying to make my project to hybrid project. i added all mvc, routing libraries.

but i can not add system.web.optimization to my project. and in auto generated code i m getting error.

//------------------------------------------------------------------------------
// <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() {

....

Upvotes: 0

Views: 1883

Answers (1)

prospector
prospector

Reputation: 3469

It's obsolete in ASP.NET MVC 4

You can get what you need from nuget:

Install-Package Microsoft.AspNet.Web.Optimization

SOURCE

Additional help:
Adding the new ASP.NET Web Optimization framework to MVC4 projects after manually upgrading them

Upvotes: 3

Related Questions