I've just upgraded a VS 2008 project to VS 2010, converting the project but keeping the target as .NET 3.5 (SP1 is installed). My project worked without issue under VS 2008 on another machine.
I've added references to System.Web.Extensions.dll but I'm still getting the following errors from code in the App_Code folder:
I am indeed targetting 3.5 already. Also some extra information below that may or may not help...
The machine has fresh installs of all the latest software as I've just upgraded the hard drive and decided to start fresh: Windows 7, VS 2010, SQL Server 2008 R2, Office 2010, Expression 4. So there's no old beta / RC versions lurking around that might be
causing issues.
Interesting... when using the Object Browser in VS 2010 and drill down to
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll > System.Web.Script.Services I can't find a ScriptService item.
Also when I drill down to C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll > System.Runtime.Serialization I don't see a Json item either. Matches the problems reported in code.
Copy System.Web.Extensions.dll from C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5 to C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0.
Still having trouble with System.Runtime.Serialization.Json.DataContractJsonSerializer so I guess ones parent assembly needs moving too. Seems a little messy to be moving around all these assemblies so I'll probably wait till microsoft releases a proper
fix.
Copy System.ServiceModel.Web.dll from C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5 to C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0, and restart Visual Studio 2010.
http://www.cnblogs.com
Marked as answer by gavinharriss on Jun 24, 2010 10:18 AM
gavinharriss
Participant
932 Points
318 Posts
Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 17, 2010 05:34 AM|LINK
I've just upgraded a VS 2008 project to VS 2010, converting the project but keeping the target as .NET 3.5 (SP1 is installed). My project worked without issue under VS 2008 on another machine.
I've added references to System.Web.Extensions.dll but I'm still getting the following errors from code in the App_Code folder:
1) Cannot find System.Web.Script.Service namespace
2) Type 'System.Web.Script.Services.ScriptService' is not defined.
3) Type 'System.Runtime.Serialization.Json.DataContractJsonSerializer' is not defined.
Anyone have any ideas what the problem might be as I'm pretty stumped? :(
</div> <div>I've got the following entries in my web.config:</div> <div></div> <div><add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></div>
asp.net 3.5 Visual studio 2010 System.Web.Extensions System.Web.Script.Service
Portfolio: www.gavinharriss.com
XiaoCheng Fa...
All-Star
17743 Points
1414 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 21, 2010 10:35 AM|LINK
Hi,
Please check the target framework in lright-click project -> properties if it correctly sets as framework 3.5?
I'm looking forward for your reply.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
gavinharriss
Participant
932 Points
318 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 21, 2010 08:29 PM|LINK
Hi XiaoCheng Fen,
Thanks for your input - much appreciated :)
I am indeed targetting 3.5 already. Also some extra information below that may or may not help...
The machine has fresh installs of all the latest software as I've just upgraded the hard drive and decided to start fresh: Windows 7, VS 2010, SQL Server 2008 R2, Office 2010, Expression 4. So there's no old beta / RC versions lurking around that might be causing issues.
Cheers,
Gavin
Portfolio: www.gavinharriss.com
gavinharriss
Participant
932 Points
318 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 23, 2010 09:26 AM|LINK
Interesting... when using the Object Browser in VS 2010 and drill down to
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll > System.Web.Script.Services I can't find a ScriptService item.
Also when I drill down to C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll > System.Runtime.Serialization I don't see a Json item either. Matches the problems reported in code.
Am I missing some install?
Portfolio: www.gavinharriss.com
gavinharriss
Participant
932 Points
318 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 23, 2010 09:47 AM|LINK
Also interesting is that if I target the 4.0 framework instead of 3.5 everything works fine. Unfortunately 4.0 isn't available on my web server yet :(
Portfolio: www.gavinharriss.com
duyong
Member
244 Points
46 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 24, 2010 09:14 AM|LINK
Copy System.Web.Extensions.dll from C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5 to C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0.
More about this problem, please visit http://www.cnblogs.com/dudu/archive/2010/06/24/1764549.html .
gavinharriss
Participant
932 Points
318 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 24, 2010 09:49 AM|LINK
Cheers Duyong,
Helped a bit - nice work :)
Still having trouble with System.Runtime.Serialization.Json.DataContractJsonSerializer so I guess ones parent assembly needs moving too. Seems a little messy to be moving around all these assemblies so I'll probably wait till microsoft releases a proper fix.
Portfolio: www.gavinharriss.com
duyong
Member
244 Points
46 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 24, 2010 10:01 AM|LINK
Copy System.ServiceModel.Web.dll from C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5 to C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0, and restart Visual Studio 2010.
gavinharriss
Participant
932 Points
318 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jun 24, 2010 10:19 AM|LINK
Awesome! Working perfectly now :) Thank you.
Portfolio: www.gavinharriss.com
gavinharriss
Participant
932 Points
318 Posts
Re: Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010
Jul 06, 2010 08:49 PM|LINK
If anyone else is encountering this issue and wants to track the bugs progress / vote the bug up with Microsoft:
https://connect.microsoft.com/VisualStudio/feedback/details/570557/targeting-net-framework-3-5-actually-targets-3-0-gac
Portfolio: www.gavinharriss.com