How to fix the error 'The name 'Scripts' does not exist in the current context'

Posted written by Paul Seal on January 24, 2017 .NET Framework

About this post

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

1

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