Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010 Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010 json json

Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010


In Visual Studio 2012, be sure to add reference for System.Web.Extensions as that is the one that holds System.Web.Script.Serialization.


Seems there's a bug from Microsoft where Target Framework for v3.5 in VS2010 is v3.0 of the GAC! Moving assemblies with issue to v3.0 folder seems to start resolving issues, but a bit messy. Think I'll wait for Microsoft to bring out a proper fix for VS 2010!

http://www.cnblogs.com/dudu/archive/2010/06/24/1764549.html

Google translate helps with this link!

More detail of assemblies copied to v3.0 folder from v3.5 folder as a work-around to this VS 2010 bug:

http://forums.asp.net/p/1569744/3942724.aspx

If anyone else is encountering this issue and wants to track / vote up the status of this bug with Microsoft:https://connect.microsoft.com/VisualStudio/feedback/details/570557/targeting-net-framework-3-5-actually-targets-3-0-gac

Update - Microsoft posted the following fix to the bug report I raised:

To build a web site targetting to 3.5, please add a compiler tag in your web.config file like I paste below, so language compilation will pick up the right version of vbc.exe. You can create a new 3.5 web site, and the default web.config has those tags you can reference.

<system.codedom>  <compilers>    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">      <providerOption name="CompilerVersion" value="v3.5"/>      <providerOption name="OptionInfer" value="true"/>      <providerOption name="WarnAsError" value="false"/>    </compiler>  </compilers></system.codedom>


  • Check your web.config assemblyentries.

  • Check your .NET Framework target in your Visual Studio2010 project, default is 4.0

  • Check IIS, make sure you are using the appropriate framework foryour site. The new .NET 4.0 install can change your default Framework to 4.0.