我自己使用的解决方法

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

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

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

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

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

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

还有其他朋友说用下面的方法,可惜我还没用上

静态类中添加如下。

 

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

namespace System.Runtime.CompilerServices
{
public class ExtensionAttribute : Attribute { }
}

缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttribute..ctor” 解决方案的更多相关文章

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

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

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

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

  3. 错误 1 缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttrib

    错误 1 缺少编译器要求的成员“System.Runtime.CompilerServices.ExtensionAttrib 删除Newtonsoft.Json.dll 引用 ,再重新引用即可. 原 ...

  4. 解决System.Runtime.CompilerServices.ExtensionAttribute..ctor 与 ‘ExtensionAttribute’ is ambiguous in the namespace ‘System.Runtime.CompilerServices’ 问题

    从VSS上获取以前的老项目,编译时报System.Runtime.CompilerServices.ExtensionAttribute..ctor 网上写的“删除 Newtonsoft.Json.N ...

  5. Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute'

    [TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as ...

  6. "Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7

    1.错误背景 系统安装了.net framework4.0.4.5,项目先使用VS2013(4.5)开发,后来又重新用VS2010开发(4.0),运行时出现这个错误 2.错误原因 In .Net 4. ...

  7. Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib 的一种情形

    没有引用任何.net 4.5的东西,也没有引用 Newtonsoft.dll,原因是引用了微软的tlb类型库,引用方法如 https://www.cnblogs.com/nanfei/p/108798 ...

  8. 未能从程序集“mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”中加载类型“System.Runtime.CompilerServices.TuppressIldasmAttribute”。已解决

    "/"应用程序中的服务器错误. 未能从程序集"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77 ...

  9. System.Runtime.CompilerServices.Unsafe

    System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Un ...

随机推荐

  1. Python编程规范

    打破一条既定规则的两个理由: 应用这个规则将导致代码可读性下降. 为了和周围的代码保持一致. 编码: 所有的 Python 脚本文件都应在文件头标上如下标识或其兼容格式的标识: # -*- codin ...

  2. 机器学习中的数学-线性判别分析(LDA), 主成分分析(PCA)

    转:http://www.cnblogs.com/LeftNotEasy/archive/2011/01/08/lda-and-pca-machine-learning.html 版权声明: 本文由L ...

  3. 【BestCoder】【Round#29】

    T1 啊……a^b 与 c^d比较大小,我们可以两边取对数,转化成 log(a^b)=b*log(a) 和d*log(c) 这样就能直接算了……然后稍微搞一下精度什么的就A了=.= //BC #29 ...

  4. oracle一些函数

    NVL( string1, replace_with):判断string1是否为空,如果是空就用replace_with代替. NVL2(E1, E2, E3)的功能为:如果E1为NULL,则函数返回 ...

  5. 【WCF--初入江湖】05 WCF异步编程

    05 WCF异步编程 一.服务设计最佳实践 在设计之初,是否用异步,应该由客户端来决定,而不应该去考虑服务的调用者调用的方式. 优点:充分利用多核CPU, 改善用户体验 缺点:滥用异步,会影响性能 二 ...

  6. Android 问题流水总结

    先来一篇环境搭建的博客 这些都是大同小异. http://blog.csdn.net/yzhj2005/article/details/6980676 http://blog.csdn.net/wan ...

  7. unity调用MMBilling_2.4.2 Android SDK.

    原地址:http://www.cnblogs.com/ayanmw/p/3736284.html 项目要使用android 的移动支付SDK 应用内付费[http://dev.10086.cn/wik ...

  8. linux源代码阅读笔记 高速缓冲区管理

    高速缓冲区是文件系统访问块设备中数据的必经要道,为了访问文件系统等块设备上的数据,内核可以每次都访问块设备,进行读写操作. 为了提高系统性能,内核在内存中开辟一个高速数据缓冲区.在Linux内核中,高 ...

  9. javascript 比较

    javascript中由于是弱类型,所以在比较的时候有较大的麻烦.这次专门做了总结: Comparison Operators Comparison operators are used in log ...

  10. 小米2s 降到1299

    关于这个价格,网上叫声一片,尤其是几天前刚买了小米2s的,恨死了雷布斯…… 以下是来自百度贴吧的帖子: [02-27 米粉杂谈]我来说个关于价格的事实吧 http://tieba.baidu.com/ ...