从VSS上获取以前的老项目,编译时报
System.Runtime.CompilerServices.ExtensionAttribute..ctor

网上写的“删除 Newtonsoft.Json.Net20.dll 后重新引用”,并没有解决这个问题。

原文首发在我的主力博客

http://anforen.com/wp/2017/07/system-runtime-compilerservices-extensionattribute-ctor-%E4%B8%8E-extensionattribute-is-ambiguous-in-the-namespace-system-runtime-compilerservices/


////缺少编译器要求的成员“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’ 问题的更多相关文章

  1. 缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttribute..ctor” 解决方案

    我自己使用的解决方法 错误产生环境及非完美解决办法 错误提示:缺少编译器要求的成员"System.Runtime.CompilerServices.ExtensionAttribute..c ...

  2. 缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttribute..ctor” 解决方案

    静态类中添加如下.此方法本人测试有效. //缺少编译器要求的成员“ystem.Runtime.CompilerServices.ExtensionAttribute..ctor” namespace  ...

  3. Json序列化提示缺少编译器要求的成员“ystem.Runtime.CompilerServices.ExtensionAttribute..ctor”

    //缺少编译器要求的成员“ystem.Runtime.CompilerServices.ExtensionAttribute..ctor” namespace System.Runtime.Compi ...

  4. 'DataVisualization' does not exist in the namespace 'System.Web.UI'一例解决办法

    之前项目是vs2010 aspx项目,用vs2017打开后,非运行状态下有一行错误:CS0234 C# The type or namespace name 'DataVisualization' d ...

  5. The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'

    场景:Visual Studio写WPF项目时,想要生成XML文件,默认的WPF项目没有引入System.XML这个dll.在[解决方案资源管理器——引用]右键添加了System.XML引用后,运行项 ...

  6. 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 ...

  7. 《ArcGIS Runtime SDK for Android开发笔记》——(3)、ArcGIS Runtime SDK概述

    1.前言 ArcGIS Runtime SDK是一整套用于构建原生及跨平台的地图应用程序的开发包,包括移动设备的Android.iOS.Windows Phone,针对桌面的.Net.Java.OSX ...

  8. 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 ...

  9. 解决在 WP8/ WP8.1 项目中 引用 C++ 组件时出现的 System.TypeLoadException 错误

    本文为个人博客备份文章,原文地址: http://validvoid.net/wp-cpp-typeloadexception/ 使用 Visual Studio 2013 update 4 在 WP ...

随机推荐

  1. 根据需要扩展java中的ThreadPoolExecutor

    经常被重写的三个方法 ThreadPoolExecutor是可扩展的,通过查看源码可以发现,它提供了几个可以在子类化中改写的方法:beforeExecute,afterExecute,terminat ...

  2. Android 高德地图定位

    创建Key 打开高德开发平台 → 我的应用 → 创建应用 → 创建新Key 说明: 1.发布版安全码获取:用自己的签名打包成apk安装软件,用SHA1工具查看 2.调试版安全码获取: 直接运行安装软件 ...

  3. 项目开发常见字符串处理模型-strstr-while/dowhile模型

    strstr-whiledowhile模型用于在母字符串中查找符合特征的子字符串. c语言库提供了strstr函数,strstr函数用于判断母字符串中是否包含子字符串,包含的话返回子字符串的位置指针, ...

  4. Django基础篇--模板和路由分发

    Django模板 首先什么是一个模板? 简单来说就是一个网页,可以被view响应给用户 目的是为了解决复杂的显示问题 2. 模板的设置问题 setting.py中的TEMPLATES配置 1)BACK ...

  5. unicode编码和utf8编码的区别

    编码格式不同在数据的传输和显示会有很大的影响.最近在使用的过程中发现一些网络文件 传输的编码格式问题,会影响文件的正常传输,于是查看了一下网上的资料,自己也写一篇 小总结. uicode是万国码,用1 ...

  6. 纯CSS选项卡

    html: <!doctype html> <html> <head> <meta charset="utf-8"> <tit ...

  7. early_suspend【转】

    android 休眠唤醒机制分析(二) - early_suspend early_suspend是Android休眠流程的第一阶段即浅度休眠,不会受到wake_lock的阻止,一般用于关闭lcd.t ...

  8. cmd 命令

    cmd 在桌面或任意磁盘新建一个TXT--输入CMD并保存--修改扩展名为.BAT md 文件夹名 新建文件夹cd 文件夹名 进入到该目录cd.. 返回上一层目录cd\ 返回根目录cd.>文件名 ...

  9. zookeeper-01 概述

    1. Zookeeper概念简介和应用场景 1.1.  概念简介 Zookeeper是一个分布式协调服务:就是为用户的分布式应用程序提供协调服务 A.zookeeper是为别的分布式程序服务的 B.Z ...

  10. java.sql.SQLSyntaxErrorException: ORA-00904: "column": 标识符无效

    java.sql.SQLSyntaxErrorException: ORA-00904: "column": 标识符无效 首先查看无效的列是不是orcale关键字 , 如果不是 , ...