How to fix “The type or namespace name ‘Optimization’ does not exist in the namespace ‘System.Web’ (are you missing an assembly reference?)
When you run an application created on asp .net, you get following error
Server Error in ‘/’ Application.
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name ‘Optimization’ does not exist in the namespace ‘System.Web’ (are you missing an assembly reference?)
Line 1: <%@ Application Language=”C#” %>
Line 2: <%@ Import Namespace=”Some_content_data” %>
Line 3: <%@ Import Namespace=”System.Web.Optimization” %>
Line 5: <script runat=”server”>
Source File: d:\inetpub\vhosts\domain.com\subdirectory\Global.asax Line: 3
Upload all missing dll to deployment folder on server, in this case upload System.Web.Optimization.dll in the bin directory
folder of your project