About this post

This post shows you how to fix the error "The name 'Scripts' does not exist in the current context"

How to fix it

The reason this error occurs is because you haven't got System.Web.Optimization referenced at the top of the View.

You canĀ fix it by adding the using statement at the top of the view like this:

@using System.Web.Optimization

If that doesn't fix it

You might not have the System.Web.Optimization dll referenced in your project. You can add it to the project using Package Manager Console

PM> Install-Package Microsoft.AspNet.Web.Optimization

That should do it

If this post helped you, please share it or leave a comment.

Thanks

Paul

Paul Seal

Umbraco MVP and .NET Web Developer from Derby (UK) who specialises in building Content Management System (CMS) websites using MVC with Umbraco as a framework. Paul is passionate about web development and programming as a whole. Apart from when he's with his wife and son, if he's not writing code, he's thinking about it or listening to a podcast about it.

Proudly sponsored by

AppVeyor

  • CI/CD service for Windows, Linux and macOS
  • Build, test, deploy your apps faster, on any platform.
stkrs

  • Custom stickers for startups, artists and brands.
  • Bespoke easy-apply, removable, custom brand stickers printed in the UK.
elmah.io

  • elmah.io is the easy error logging and uptime monitoring service for .NET.
  • Take back control of your errors with support for all .NET web and logging frameworks.
uSync Complete

  • uSync.Complete gives you all the uSync packages, allowing you to completely control how your Umbraco settings, content and media is stored, transferred and managed across all your Umbraco Installations.