Adding System.Web.Script reference in class library

asp.netNamespacesClass Library

asp.net Problem Overview


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?)

asp.net Solutions


Solution 1 - asp.net

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.

Solution 2 - asp.net

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser112799View Question on Stackoverflow
Solution 1 - asp.netM4NView Answer on Stackoverflow
Solution 2 - asp.netGaurang DhandhukiyaView Answer on Stackoverflow