解决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 ...
随机推荐
- js 中三元运算符的运用
外层为false,逐级向内层判断 $scope.nums=700; $scope.result=($scope.nums>300)?($scope.nums>400)?($scope.nu ...
- JS输入框正则校验
1. 开发中需要对etl组件统一进行input输入框校验,允许为空,可以不校验,默认校验长度和特殊字符,代码如下,记录以备复用. /** * 数据值校验工具类 */ var checkService ...
- python练习(-)
简单的爬虫示例: import urllib.request #python2.x版本为urllib2url = 'http://www.douban.com/'webPage=urllib.requ ...
- 聊聊setTimeout和setInterval线程
在聊setTimeout和setInterval这两个事件的前,先聊另外一个与之密切关联的知识点,那就是线程(thread).而线程有常常跟另外一个词语--“进程”一起出现.那么何为线程?何为线程呢? ...
- Spring security实现国际化问题
这两天Spring用户登录国际化这个问题困扰我好久啊,于昨天晚上终于把它干掉了. 场景就是我们公司的产品-incopat,需要支持中英文,用户登录这块用的spring自带的security,需求讲的通 ...
- 简单整理关于C#和Java的区别
相信每个程序猿都有自己最喜欢的编程语言,然而对于编程语言似乎形成一条独特的鄙视链,就如Java和C#常常两边的开发者都是相互鄙视,然后他们一起共同鄙视全世界最好的编程语言——PHP 哈哈,但是其实我想 ...
- Linux Regulator Framework(2)_regulator driver
转自蜗窝科技:http://www.wowotech.net/pm_subsystem/regulator_driver.html 说实话,这篇好难懂啊... 1. 前言 本文从regulator d ...
- sysfs_create_group创建sysfs接口
在调试驱动,可能需要对驱动里的某些变量进行读写,或函数调用.可通过sysfs接口创建驱动对应的属性,使得可以在用户空间通过sysfs接口的show和store函数与硬件交互: Syss接口可通过sys ...
- 字典Key值为变量
m='aaa4a' d = dict(name=m) print d['name']
- npm install node-sass 本地安装失败
$ npm install --save node-sass --registry=https://registry.npm.taobao.org --disturl=https://npm.taob ...