从VSS上获取之前的老项目,编译时报
System.Runtime.CompilerServices.ExtensionAttribute..ctorjson
网上写的“删除 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也不行。3d
就是前面加的那3行代码,与已有的冲突了。
因此删除前面加的3行代码。删除这3行代码,又会回到最初的问题,编译时报System.Runtime.CompilerServices.ExtensionAttribute..ctorblog
最后把目标框架,选择到最新。像这样get
就好了编译器