title: MVC 4 @Scripts "does not exist"
body: <p>I have just created an ASP.NET MVC 4 project and used Visual Studio 2012 RC to create a Controller and Razor Views for <code>Index</code> and <code>Create</code> Actions.</p>
  
  <p>When I came to run the application, and browsed to the <code>Create</code> view, the following error was shown:</p>
  
  <blockquote>
    <p>Compiler Error Message: CS0103: The name 'Scripts' does not exist in
    the current context</p>
  </blockquote>
  
  <p>The problem is the following code which was added automatically to the bottom of the View:</p>
  
  <pre><code>@section Scripts {
      @Scripts.Render("~/bundles/jqueryval")
  }
  </code></pre>
  
  <p>Why does Scripts not exist?</p>
  
  <p>I looked at the base Web Page class in Assembly System.Web.Mvc.dll, v4.0.0.0</p>
  
  <p>I can see the following helper properties available:</p>
  
  <ul>
  <li>Ajax</li>
  <li>Html</li>
  <li>Url</li>
  </ul>
  
  <p>But nothing named Scripts.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>My Web.config file looks like this (untouched from the one that Visual Studio created):</p>
  
  <pre><code>  &lt;system.web.webPages.razor&gt;
      &lt;host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;pages pageBaseType="System.Web.Mvc.WebViewPage"&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.Mvc" /&gt;
          &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
          &lt;add namespace="System.Web.Mvc.Html" /&gt;
          &lt;add namespace="System.Web.Routing" /&gt;
        &lt;/namespaces&gt;
      &lt;/pages&gt;
    &lt;/system.web.webPages.razor&gt;
  </code></pre>
  
  <p><strong>EDIT #2:</strong></p>
  
  <p>People are blogging about using the <code>@Scripts</code> helper:</p>
  
  <ul>
  <li><a href="http://www.hanselman.com/blog/VisualStudio2012RCIsReleasedTheBigWebRollup.aspx" rel="noreferrer">SCOTT HANSELMAN Blog</a></li>
  <li><a href="http://codebetter.com/howarddierking/2012/06/04/web-optimization-in-visual-studio-2012-rc" rel="noreferrer">Codebetter.com</a></li>
  </ul>
  
  <p>Yet having just installed Visual Studio 2012 RC onto a fresh Windows 8 install I am still unable to use <code>@Scripts</code> even though Visual Studio adds it to the generated View!</p>
  
  <p><strong>Solutions are presented below.</strong></p>
  
  <p>I am not sure how to close this, because in the end an update seemed to resolve the issue. I double checked I had performed a clean install, using a new project. But the same failing project I had made works fine now after various updates and no manual obvious intervention. Thanks for all of the thoughts but there was definitely an issue at the time ;)</p>