解决System.Runtime.CompilerServices.ExtensionAttribute..ctor 与 ‘ExtensionAttribute’ is ambiguous in the namespace ‘System.Runtime.CompilerServices’ 问题
从VSS上获取以前的老项目,编译时报
System.Runtime.CompilerServices.ExtensionAttribute..ctor
网上写的“删除 Newtonsoft.Json.Net20.dll 后重新引用”,并没有解决这个问题。
原文首发在我的主力博客
用
////缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttribute..ctor”
namespace System.Runtime.CompilerServices
{
public class ExtensionAttribute : Attribute { }
}
倒是编译通过了,更新到老网站上,即无法打开页面,报这个错误。
'ExtensionAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'
用最新的Newtonsoft.json也不行。
就是前面加的那3行代码,与已有的冲突了。
所以删除前面加的3行代码。删除这3行代码,又会回到最初的问题,编译时报System.Runtime.CompilerServices.ExtensionAttribute..ctor
最后把目标框架,选择到最新。像这样

就行了
解决System.Runtime.CompilerServices.ExtensionAttribute..ctor 与 ‘ExtensionAttribute’ is ambiguous in the namespace ‘System.Runtime.CompilerServices’ 问题的更多相关文章
- 缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttribute..ctor” 解决方案
我自己使用的解决方法 错误产生环境及非完美解决办法 错误提示:缺少编译器要求的成员"System.Runtime.CompilerServices.ExtensionAttribute..c ...
- 缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttribute..ctor” 解决方案
静态类中添加如下.此方法本人测试有效. //缺少编译器要求的成员“ystem.Runtime.CompilerServices.ExtensionAttribute..ctor” namespace ...
- Json序列化提示缺少编译器要求的成员“ystem.Runtime.CompilerServices.ExtensionAttribute..ctor”
//缺少编译器要求的成员“ystem.Runtime.CompilerServices.ExtensionAttribute..ctor” namespace System.Runtime.Compi ...
- 'DataVisualization' does not exist in the namespace 'System.Web.UI'一例解决办法
之前项目是vs2010 aspx项目,用vs2017打开后,非运行状态下有一行错误:CS0234 C# The type or namespace name 'DataVisualization' d ...
- The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'
场景:Visual Studio写WPF项目时,想要生成XML文件,默认的WPF项目没有引入System.XML这个dll.在[解决方案资源管理器——引用]右键添加了System.XML引用后,运行项 ...
- ArcGIS Runtime SDK for WPF已不更新,后续将被ArcGIS Runtime SDK for .NET取代
ArcGIS Runtime SDK 10.2.5 for WPF is now available! by mbranscomb and Rex Hansen on January 27, 2015 ...
- 《ArcGIS Runtime SDK for Android开发笔记》——(3)、ArcGIS Runtime SDK概述
1.前言 ArcGIS Runtime SDK是一整套用于构建原生及跨平台的地图应用程序的开发包,包括移动设备的Android.iOS.Windows Phone,针对桌面的.Net.Java.OSX ...
- The type or namespace name 'Html' does not exist in the namespace 'System.Web.Mvc' (are you missing an assembly reference?)
The type or namespace name 'Html' does not exist in the namespace 'System.Web.Mvc' (are you missing ...
- 解决在 WP8/ WP8.1 项目中 引用 C++ 组件时出现的 System.TypeLoadException 错误
本文为个人博客备份文章,原文地址: http://validvoid.net/wp-cpp-typeloadexception/ 使用 Visual Studio 2013 update 4 在 WP ...
随机推荐
- CSS expression属性
expression属性是在IE5版本之后支持使用的,用来把CSS属性和JavaScript脚本关联起来.简单粗暴的说,该属性是用来调用JavaScript代码的. CSS属性后面是一段JavaScr ...
- 我的Java之旅 第八课 Servlet 进阶API、过滤器与监听器
1.Servlet.ServletConfig与GenericServlet 首次请求的顺序 => 生成HttpServletRequest与HttpServletRespon ...
- 惊闻企业Web应用生成平台 活字格 V4.0 免费了,不单可视化设计器免费,服务器也免费!
官网消息: 针对活字格开发者,新版本完全免费!您可下载活字格 Web 应用生成平台 V4.0 Updated 1,方便的创建各类 Web 应用系统,任意部署,永不过期. 我之前学习过活字格,也曾经向用 ...
- springcloud 入门 8 (config配置中心)
Spring Cloud Config: 配置中心为了方便服务配置文件统一管理,实时更新,所以需要分布式配置中心组件,它就是Spring Cloud Config. 在分布式系统中,由于服务数量巨多, ...
- enum类使用
状态常量类使用enum public class TestEnums{ public enum STATUS{ NOMAL("01","正常"), DELETE ...
- 【第四篇】SAP ABAP7.5x新语法之CREATE DATA&INTERFACE
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文地址:SAP ABAP7.5x系列之CREATE DA ...
- windows下设置JupyterNotebook默认目录
目录 windows下设置JupyterNotebook默认目录 生成配置文件 设置默认工作目录 设置快捷方式中的目标与起始位置 直接修改anaconda中的相关配置文件 windows下设置Jupy ...
- win7计划任务报该任务映像己损坏或己篡改
目录 win7计划任务报该任务映像己损坏或己篡改 前言 解决方案 排查损坏的计划任务映像 win7计划任务报该任务映像己损坏或己篡改 文:铁乐与猫 2018-9-20 前言 win7下想自定义一些计划 ...
- 03LaTeX学习系列之---TeXworks的使用
目录 03TeXworks的使用 目录 前言 (一)Texworks的认识 1.TeXworks的安装 2.TeXworks的优点 3.TeXworks的界面 (二)Texworks的编译与查看 1. ...
- IO流_PrintWriter(字符打印流)与PrintStream(字节打印流)
PrintStream: 1.提供了打印方法可以对多种数据类型值进行打印,并保持数据的表示形式 2.它不抛IOException 3.构造函数接受三种类型的值: 字符串路径 File对象 ...