[asp.net] Adding System.Web.Script reference in class library

I am currently moving code from my app_code folder to a class library. I have tagged several methods with [System.Web.Script.Serialization.ScriptIgnore] attributes. My class library cannot see this namespace. My add references dialog cannot see this namespace. How do I properly use this tag from a class library?

Here is the error: The type or namespace name 'ScriptIgnoreAttribute' could not be found (are you missing a using directive or an assembly reference?)

This question is related to asp.net namespaces class-library

The answer is


The ScriptIgnoreAttribute class is in the System.Web.Extensions.dll assembly (Located under Assemblies > Framework in the VS Reference Manager). You have to add a reference to that assembly in your class library project.

You can find this information at top of the MSDN page for the ScriptIgnoreAttribute class.


You need to add a reference to System.Web.Extensions.dll in project for System.Web.Script.Serialization error.


Examples related to asp.net

RegisterStartupScript from code behind not working when Update Panel is used You must add a reference to assembly 'netstandard, Version=2.0.0.0 No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization How to use log4net in Asp.net core 2.0 Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state How to create roles in ASP.NET Core and assign them to users? How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause() ASP.NET Core Web API Authentication Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0 WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery

Examples related to namespaces

Class 'App\Http\Controllers\DB' not found and I also cannot use a new Model How do I get an object's unqualified (short) class name? socket.error:[errno 99] cannot assign requested address and namespace in python What is the use of "using namespace std"? Visibility of global variables in imported modules Using :: in C++ 'namespace' but is used like a 'type' type object 'datetime.datetime' has no attribute 'datetime' Why am I getting error CS0246: The type or namespace name could not be found? string in namespace std does not name a type

Examples related to class-library

What is the difference between .NET Core and .NET Standard Class Library project types? How to open .dll files to see what is written inside? app.config for a class library How can I use external JARs in an Android project? Adding System.Web.Script reference in class library