title: The type or namespace name 'Optimization' does not exist in the namespace 'System.Web'
body: <p>I am deploying a new website as my main site and it works beautifully.</p>
  <p>All of my applications under the root url work as well, except for one. It is a legacy system (c#.net) that is heavily used and unfortunately, I do not have access to the source code.</p>
  <p>When I run the legacy application <a href="http://www.mysite.com/crm" rel="nofollow noreferrer">www.mysite.com/crm</a> I get the following error:</p>
  <pre><code>Server Error in '/crm' Application.
  
  Compilation Error
  
  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?)
  
  Source Error:
  
  
  Line 17:     &lt;pages&gt;
  Line 18:       &lt;namespaces&gt;
  Line 19:         &lt;add namespace=&quot;System.Web.Optimization&quot; /&gt;
  Line 20:       &lt;/namespaces&gt;
  Line 21:     &lt;controls&gt;
  
  Source File: e:\WebSites\newsite\Web.config    Line: 19 
  
  
  Show Detailed Compiler Output:
  
  Show Complete Compilation Source:
  
  
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446
  </code></pre>
  <p>The error is listing the web.config for the main site, which works. However, it happens only when I run the application under the main site.</p>
  <p>This is running on Server 2008 R2 and IIS7</p>
  <p>How do I correct this? What else can I try?</p>
  <p><strong>UPDATE</strong></p>
  <p>I don't know if it makes a difference, but the Web.Config it references in the error is for the new website, not for the legacy application. I am not sure why the main site config is a factor at all.</p>
  <p><strong>CLARIFICATION</strong></p>
  <p>I don't have access to the source code of the legacy application so I cannot adjust the properties for that application. Pasting the Optimization dll into the site didn't fix it either. It may work for other users, but not for me.</p>
  <p><strong>WORK AROUND</strong></p>
  <p>I setup the new site under another URL and redirect traffic to the root URL to the new URL and allow the legacy application to run as is until we can replace it. Very sloppy solution, but it works for now.</p>