如何解决cs0433 system.web.extensions的错误

如果机器上同时安装了VS2008和VS2005,在用2005编译AJAX项目时,可能会出现这样的错误:

Compiler Error Message: CS0433: The type 'System.Web.UI.ScriptManager' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll'

解决方案:
1.打开web.config,找到以下相关结点:
  <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"></add>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
2.将这些结果注释掉或删除,再重新编译就可以了.

这是因为VS2005编译的AJAX是1.0的,而VS2008能同时编译AJAX1.0和其他版本的.所以会出现冲突.

出错页面提示信息如下:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'System.Web.UI.ScriptManager' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll'

Source Error:

Line 8:  <body>
            Line 9:      <form id="form1" runat="server">
            Line 10:         <asp:ScriptManager ID="ScriptManager1" runat="server" />
            Line 11:         <div>
            Line 12:             <asp:UpdatePanel ID="UpdatePanel1" runat="server">

Source File: d:\AJAXEnabledWebSite1\Default.aspx    Line: 10
致力于SharePoint编程,配置. MSN:lm-zsx@hotmail.com.
Tag标签: AJAX
posted @ 2008-01-23 10:06 名可真难起 阅读(1947) 评论(3)  编辑 收藏 网摘

  回复  引用    
#1楼2008-08-19 18:07 | 高文龙[未注册用户]
呵呵不错哈 解决我遇到的问题


加我 msn好不 webgee@hotmail.com

  回复  引用    
#2楼2009-02-27 14:16 | 大大[未注册用户]
.NET就是这样, 经常出些莫名其妙的错误
  回复  引用    
#3楼2009-05-05 15:55 | 一雀[未注册用户]
怎么重新编译啊



发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 1049630




相关文章:

相关链接: