Solve the problem of System. Runtime. CompilerServices. ExtensionAttribute... ctor and 'extensionattribute' is ambiguous in the namespace 'System. Runtime. compilerservice'. ExtensionAttribute
Obtain the previous old project from VSS and compile the project.
System. Runtime. CompilerServices. ExtensionAttribute... ctor
The "delete Newtonsoft. Json. netw.dll and rereference it" written on the Internet does not solve this problem.
The original Article was first published on my main blog
Http://anforen.com/wp/2017/07/system-runtime-compilerservices-extensionattribute-ctor-%E4%B8%8E-extensionattribute-is-ambiguous-in-the-namespace-system-runtime-compilerservices/
Use
//// The member "System. Runtime. CompilerServices. ExtensionAttribute... ctor" that lacks the compiler requirements"
Namespace System. Runtime. CompilerServices
{
Public class ExtensionAttribute: Attribute {}
}
If the compilation is successful, the page cannot be opened after it is updated to the old website. This error is reported.
'Extensionattribute' is ambiguous in the namespace 'System. Runtime. compilerservice'
It does not work with the latest Newtonsoft. json.
The three lines of code added above conflict with the existing ones.
Therefore, delete the three lines of code added above. Deleting these three lines of code will return to the initial issue. The compilation times System. Runtime. CompilerServices. ExtensionAttribute.. ctor
Finally, select the target framework to the latest version. Like this
That's all.