原文:关于异常Microsoft.CSharp.RuntimeBinder.RuntimeBinderException

关于Microsoft.CSharp.RuntimeBinder.RuntimeBinderException的异常一般来自于两种,

第一种:

Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported

解决它的办法是,直接在项目引用中添加 Micorsoft.Csharp 就可以了。

第二种:

an exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException'

引起这种异常的错误是因为匿名类型是不能跨程序集(assembly)的,第一种解决办法是使用 Expando ,第二个办法是在源程序集的AssemblyInfo.cs中加入:

[assembly: InternalsVisibleTo("NameSpace1.SubNameSpace1")]

使用第二种方法后,匿名类型可以传递到目标程序集。

----------------------问题2-----------------------------------------------

Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.Convert'

解决方法:添加引用Microsoft.CSharp.dll. This provides the required types for using dynamic in C#.

关于异常Microsoft.CSharp.RuntimeBinder.RuntimeBinderException的更多相关文章

  1. Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: “object”未包括“get_Range”的定义

    asp.net操作Excel合并单元格时,抛出了异常: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: "object" ...

  2. 预定义的类型“Microsoft.CSharp.RuntimeBinder.Binder”未定义或未导入

    http://www.mzwu.com/article.asp?id=3611 因为新加了Microsoft.CSharp的引用, 只需要重新生成一下项目,就可以消除这个错误提示

  3. CS0656 缺少编译器要求的成员“Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create”

    问题出现原因:在net core使用动态类型dynamic,在编译的时候提示错误信息如上. 解决方案: 1.不用dynamic类型 2.在使用的地方添加一个dll,Microsoft.CSharp,或 ...

  4. .net 4.0 : Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.****'

    解决办法,添加 MicroSoft.CSharp 的引用.

  5. 是否缺少对 Microsoft.CSharp.dll 和 System.Core.dll 的引用?

    错误提示 : 预定义的类型“Microsoft.CSharp.RuntimeBinder.Binder”未定义或未导入 是否缺少对 Microsoft.CSharp.dll 和 System.Core ...

  6. [C#] 生成 (web): 未能加载文件或程序集“Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7

    有时候编译asp.net会遇到奇怪的错误: 生成 (web): 未能加载文件或程序集"Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, ...

  7. Microsoft.CSharp.CSharpCodeProvider

    Microsoft.CSharp.CSharpCodeProvider MSDN 提供对 C# 代码生成器和代码编译器的实例的访问.类提供可用来检索 C# ICodeGenerator 和 ICode ...

  8. 【.net】“Newtonsoft.Json”已拥有为“Microsoft.CSharp”定义的依赖项。

    #事故现场: “Newtonsoft.Json”已拥有为“Microsoft.CSharp”定义的依赖项. #事故原因: 安装的Newtonsoft.Json版本为11.0.2,版本过高,与Micro ...

  9. 找不到编译动态表达式所需的一种或多种类型。是否缺少对 Microsoft.CSharp.dll 和 System.Core.dll 的引用?

    提示“找不到编译动态表达式所需的一种或多种类型.是否缺少对 Microsoft.CSharp.dll 和 System.Core.dll 的引用? ”错误 解决方法:   将引入的COM对象(misc ...

随机推荐

  1. 怎么在centos中查看某个目录的树结构?

    1.在ubuntu系统中默认是没有tree这个命令的,需要安装,用下面的命令就可以安装tree这个命令工具sudo apt-get install tree. 在centos中也没有,需要提前进行安装 ...

  2. Retrofit的使用

    参照文档:http://gank.io/post/56e80c2c677659311bed9841 一.创建Retrofit mRetrofit = new Retrofit.Builder() .b ...

  3. hdu 5823 color II 状压dp

    题目链接 给n个点 n<=18. 然后给出它们两两之间是否有边相连. 问你这个图的所有子集,最少要用多少种颜色来染色, 如果两个点相连, 那么这两个点不能染同样的颜色. 先预处理出所有的点独立集 ...

  4. 【写一个自己的js库】 3.添加几个处理字符串的方法

    1.生成重复的字符串 if(!String.repeat){ String.prototype.repeat = function (count){ return new Array(count + ...

  5. createDocumentFragment

    http://www.cnblogs.com/myjavascript/p/3708920.html 对于循环批量操作页面的DOM有很大帮助!利用文档碎片处理,然后一次性append,并且使用原生的j ...

  6. Erlang语言介绍

    Erlang (/ˈɜrlæŋ/ er-lang) is a general-purpose concurrent, garbage-collected programming language an ...

  7. JavaEE Tutorials (26) - 批处理

    26.1批处理介绍391 26.1.1批处理作业中的步骤391 26.1.2并行处理392 26.1.3状态和判定元素392 26.1.4批处理框架功能39326.2Java EE中的批处理394 2 ...

  8. SQLite.dll混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。

    其他信息: V5.7.4.4 Can't find the System.Data.SQLite.dll more info : 混合模式程序集是针对"v2.0.50727"版的运 ...

  9. scanf与printf用法详解

    一.scanf家族 1.scanf家族的原型 int scanf(char const *format,...); int fscanf(FILE *stream,char const *format ...

  10. IOS 开展 分别制定了iphone 和 ipad 好? 或开发一个 Universal好?

    最近因为工作的需要,.因为时间短的开发周期 开发的需要 积 至iphone 和 ipad 台 执行 优势的版本号 1.安装包,轻松管理,分布 2.您下载iphone,ipad 会自己主动下载 3.审核 ...