加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – BC30560:’ExtensionAttribute’在名称空间’System

发布时间:2020-12-15 22:18:45 所属栏目:asp.Net 来源:网络整理
导读:我有asp.net项目(在.net 2.0中),我将项目转换为.net 4.0. 在我成功构建项目之后,我在浏览器上启动了网站,它会抛出以下错误: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Pl
我有asp.net项目(在.net 2.0中),我将项目转换为.net 4.0.
在我成功构建项目之后,我在浏览器上启动了网站,它会抛出以下错误:

Compilation Error

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: BC30560: ‘ExtensionAttribute’ is ambiguous in
the namespace ‘System.Runtime.CompilerServices’.

Source Error:

[No relevant source lines]

Source File: InternalXmlHelper.vb Line: 9

……..

请给我一些想法来解决它.

解决方法

在.NET 2中使用C#3(或更高版本)编译器的扩展方法(对于LINQ等)的一个常见技巧是在正确的命名空间中定义您自己的ExtensionAttribute.

现在您已升级到更高版本的.NET,您需要删除此现在冗余的额外属性.找到代码中定义的位置并将其删除.还要检查LINQBridge等外部库 – 你不再需要它了.

找到它的一种方法是使用对象浏览器并搜索ExtensionAttribute.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读