I'm messing around with some JSON and I'm trying to use the JavascriptSeralizer Class but I cannot for the love of god find a link to find where to add the assembly to my project. Someone help please!
Update I'm using .NET 4.0 and its not in the .Net tab when you right click on references -> add reference in the solution explorer of Visual C# 2010.
The system. web. extensions element enables you to configure ASP.NET applications that can be used by AJAX-enabled clients, Windows Communication Foundation (WCF) clients (SOAP clients), and . NET Framework clients.
None of the System. Web pipeline will run for your ASP.NET Core application so you can't do what you are trying to do.
HttpApplication Class (System.Web) Defines the methods, properties, and events that are common to all application objects in an ASP.NET application. This class is the base class for applications that are defined by the user in the Global.
I had this problem myself. Most of the information I could find online was related to people having this problem with an ASP.NET web application. I was creating a Win Forms stand alone app so most of the advice wasn't helpful for me.
Turns out that the problem was that my project was set to use the ".NET 4 Framework Client Profile" as the target framework and the System.Web.Extensions reference was not in the list for adding. I changed the target to ".NET 4 Framework" and then the reference was available by the normal methods.
Here is what worked for me step by step:
EDIT:
The info below is only applicable to VS2008 and the 3.5 framework. VS2010 has a new registry location. Further details can be found on MSDN: How to Add or Remove References in Visual Studio.
ORIGINAL
It should be listed in the .NET tab of the Add Reference dialog. Assemblies that appear there have paths in registry keys under:
HKLM\Software\Microsoft\.NETFramework\AssemblyFolders\
I have a key there named Microsoft .NET Framework 3.5 Reference Assemblies with a string value of:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\
Navigating there I can see the actual System.Web.Extensions dll.
EDIT:
I found my .NET 4.0 version in:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Extensions.dll
I'm running Win 7 64 bit, so if you're on a 32 bit OS drop the (x86).
The assembly was introduced with .NET 3.5 and is in the GAC.
Simply add a .NET reference to your project.
Project -> Right Click References
-> Select .NET
tab -> System.Web.Extensions
If it is not there, you need to install .NET 3.5 or 4.0.
Your project is mostly likely targetting .NET Framework 4 Client Profile. Check the application tab in your project properties.
This question has a good answer on the different versions: Target framework, what does ".NET Framework ... Client Profile" mean?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With