静态类中添加如下。此方法本人测试有效。

//缺少编译器要求的成员“ystem.Runtime.CompilerServices.ExtensionAttribute..ctor”
namespace System.Runtime.CompilerServices
{
    public class ExtensionAttribute : Attribute { }
}

网上找的其他方法

错误产生环境及非完美解决办法

错误提示:缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttribute..ctor”

这个错误真的非常诡异,因为双击这个错误的时候无法定位到出错的地方。

而且这个错误实在是非常不明确。

其实,产生这个错误的人大部分是因为引用了 Newtonsoft.Json.Net20.dll 这个类库。

网上简单的解决方式是:“删除 Newtonsoft.Json.Net20.dll 后重新引用”

 

相关文章:

  • 2021-12-05
  • 2021-05-04
  • 2022-12-23
  • 2022-02-17
  • 2022-01-17
  • 2021-04-12
  • 2021-07-28
猜你喜欢
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案