從VSS上獲取以前的老項目,編譯時報System.Runtime.CompilerServices.ExtensionAttribute..ctor 網上寫的“刪除 Newtonsoft.Json.Net20.dll 後重新引用”,並沒有解決這個問題。 原文首發在我的主力博客 http://anfo ...
從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
最後把目標框架,選擇到最新。像這樣
就行了