title: DisplayMode / DiplayMode Providers Issue Asp.Net MVC 4
body: <p>I've been trying out MVC 4 lately. Started with the developer preview, and now the beta.</p>
  
  <p>Everything was working quite well, but I wanted make use of the built in minification &amp; compression features. But it seemed like it wasn't present in the developer previews as no matter what i attempted the code wouldn't compile/provide a clean run, if i added anything bundling related. I then did some research and saw MVC 4 beta.</p>
  
  <p>I uninstalled mvc 4 and re-installed it using the beta installer. Created a new project and it ran fine using the bundling. But no matter what I did, (Including copying the dll's from the new solution, to my old one.) I cant get the bundling to work in my existing solution</p>
  
  <p>In the global.asax.cs file </p>
  
  <p>[1]</p>
  
  <p><em><strong>BundleTable</em></strong>.Bundles.RegisterTemplateBundles();</p>
  
  <p>Bundle Table wont even register. (gets red underline)</p>
  
  <p>[2]</p>
  
  <p>I tried something else just to verify that the new dll are being used.</p>
  
  <p>previously to check for a display mode the following would be used</p>
  
  <pre><code>[a]
      DisplayModes.Modes.Insert(0, new DefaultDisplayMode("iPhone")
      {
        ContextCondition = (context =&gt; context.Request.UserAgent.IndexOf
                           ("iPhone", StringComparison.OrdinalIgnoreCase) &gt;= 0)
      });
  </code></pre>
  
  <p>but it's since been updated to </p>
  
  <pre><code>[b]
      DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("iPhone")
      ...
  </code></pre>
  
  <p>The code will compile if I use [a], and not [b], but it wont give me a clean run using [a], as it errors out during runtime </p>
  
  <p><em>Could not load type 'System.Web.WebPages.DisplayModes' from assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.</em></p>
  
  <p>Could it be that my old solution is still referencing the old dlls somehow, even if i copied the new ones over, removed the references and manually pointed them to the new ones?</p>
  
  <hr>
  
  <p>The reference entries as requested by @Brad Christie</p>
  
  <pre><code>&lt;Reference Include="EntityFramework"&gt;
    &lt;HintPath&gt;..\packages\EntityFramework.4.1.10331.0\lib\net40\EntityFramework.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="Microsoft.CSharp" /&gt;
  &lt;Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\System.Json.4.0.20126.16343\lib\net40\System.Json.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\System.Net.Http.2.0.20126.16343\lib\net40\System.Net.Http.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\System.Net.Http.Formatting.4.0.20126.16343\lib\net40\System.Net.Http.Formatting.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Net.Http.WebRequest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\System.Net.Http.2.0.20126.16343\lib\net40\System.Net.Http.WebRequest.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\AspNetWebPages.Core.2.0.20126.16343\lib\net40\System.Web.Helpers.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\AspNetWebApi.Core.4.0.20126.16343\lib\net40\System.Web.Http.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Http.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\System.Web.Http.Common.4.0.20126.16343\lib\net40\System.Web.Http.Common.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\AspNetWebApi.4.0.20126.16343\lib\net40\System.Web.Http.WebHost.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\AspNetMvc.4.0.20126.16343\lib\net40\System.Web.Mvc.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Optimization"&gt;
    &lt;HintPath&gt;..\packages\Microsoft.Web.Optimization.1.0.0-beta\lib\net40\System.Web.Optimization.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\AspNetRazor.Core.2.0.20126.16343\lib\net40\System.Web.Razor.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\AspNetWebPages.Core.2.0.20126.16343\lib\net40\System.Web.WebPages.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\AspNetWebPages.Core.2.0.20126.16343\lib\net40\System.Web.WebPages.Deployment.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;Private&gt;True&lt;/Private&gt;
    &lt;HintPath&gt;..\packages\AspNetWebPages.Core.2.0.20126.16343\lib\net40\System.Web.WebPages.Razor.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  </code></pre>