title: Designer insisting on 'System.Web.UI.WebControls', which doesn't exist
body: <p>I've encountered an odd problem: I'm trying to migrate an ASP.NET 4.0 website to an ASP.NET web application. Visual Studio's "Convert to Web Application" function actually worked quite nicely, but the only thing that's not working are the references to charts. I'm getting the error:</p>
  
  <blockquote>
    <p>The type or namespace name 'Chart' does not exist in the namespace
    'System.Web.UI.WebControls'</p>
  </blockquote>
  
  <p>From the .designer file. The designer is automatically creating this type of code:</p>
  
  <pre><code>protected global::System.Web.UI.WebControls.Chart ClientHoursPie;
  </code></pre>
  
  <p>Based on research I have done, the proper 4.0 namespace to use for charts is System.Web.UI.DataVisualization.Charting. I have added the following components in the web.config (copied from the original website, which was working fine):</p>
  
  <pre><code>&lt;httpHandlers&gt;
      &lt;add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/&gt;
  &lt;/httpHandlers&gt;
  &lt;compilation debug="true" targetFramework="4.0"&gt;
      &lt;assemblies&gt;
          &lt;add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;/assemblies&gt;
  &lt;/compilation&gt;
  </code></pre>
  
  <p>I can correct the namespaces in the designer files but each time the aspx file is saved, the designer reverts back to the old namespace.</p>
  
  <p>I would love to avoid having to rebuild all of the individual pages from scratch. Is there a setting somewhere that I've missed?</p>
  
  <p>Thanks in advance.</p>