升级到Visual Studio 2010后找不到System.Web.Script.Service命名空间错误 [英] Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010

查看:238
本文介绍了升级到Visual Studio 2010后找不到System.Web.Script.Service命名空间错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将VS 2008项目升级到VS 2010,将项目转换但将目标保持为.NET 3.5(已安装SP1).我的项目在另一台计算机上的VS 2008下工作正常.

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.

我已经添加了对System.Web.Extensions.dll的引用,但是我仍然从App_Code文件夹中的代码中得到以下错误:

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)找不到System.Web.Script.Service命名空间.

1) Cannot find System.Web.Script.Service namespace.

2)类型"System.Web.Script.Services.ScriptService"未定义.

2) Type 'System.Web.Script.Services.ScriptService' is not defined.

3)未定义类型"System.Runtime.Serialization.Json.DataContractJsonSerializer".

3) Type 'System.Runtime.Serialization.Json.DataContractJsonSerializer' is not defined.

任何人都不清楚我很困惑,可能是什么问题? :(

Anyone have any ideas what the problem might be as I'm pretty stumped? :(

推荐答案

似乎来自Microsoft的一个错误,即VS2010中的v3.5的目标框架是GAC的v3.0!将有问题的程序集移动到v3.0文件夹似乎开始解决问题,但是有点混乱.想我会等微软为VS 2010提出正确的修补程序!

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翻译可通过此链接提供帮助!

Google translate helps with this link!

有关此VS 2010错误的变通办法,是从v3.5文件夹复制到v3.0文件夹的程序集的更多详细信息:

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

如果其他任何人遇到此问题,并希望与Microsoft一起跟踪/投票赞成此错误的状态: https://connect.microsoft.com/VisualStudio/feedback/details/570557/targeting-net-framework-3-5-actually-targets-3-0-gac

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

更新-Microsoft对我提出的错误报告发布了以下修复程序:

要构建一个针对3.5的网站,请像我在下面粘贴的那样在web.config文件中添加一个编译器标记,以便语言编译将选择正确的vbc.exe版本.您可以创建一个新的3.5网站,默认的web.config具有您可以引用的标记.

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>

这篇关于升级到Visual Studio 2010后找不到System.Web.Script.Service命名空间错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆