原文:关于异常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. apache AH01630: client denied by server configuration错误解决方法

    今天本来是想要在自己本地搭建一个wamp环境用来做一些代码的测试和框架的学习. 鉴于目前工作的时候用到了php5.5,所以就用了wamp-server V2.5版本,安装完成之后配置虚拟主机一直出现4 ...

  2. FTP下文件夹权限的设置755,766,777,644代表什么意思

    一般情况下,为了网站更安全,我们需要给文件或文件夹设置权限,在采用FTP登录的方式下,经常会用到755,766,777,644等设置. 具体这些数字都代表什么意思呢? 这三个数字分别表示:不同用户或用 ...

  3. TensorFlow深度学习笔记 文本与序列的深度模型

    Deep Models for Text and Sequence 转载请注明作者:梦里风林 Github工程地址:https://github.com/ahangchen/GDLnotes 欢迎st ...

  4. 算法分析-插入排序INSERT_SORT与选择排序SELECT_SORT【线性方法】

    var A = [5, 2, 4, 6, 1, 3]; console.log("排序前-:") A.forEach(function (element, index, arr) ...

  5. python学习day4

    目录 一.迭代器 二.yield生成器 三.装饰器 四.递归 五.基础算法 迭代器 #1.在不使用for循环的情况下 li = [11 ,22, 33, 44] #count = len(li) #s ...

  6. DataTable AsEnumerable 的使用

    var p = DataTable.AsEnumerable().Where(t => t.Field<int>("ChannelID") == int.Pars ...

  7. Jar

    http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Intro http://docs.oracle.com/java ...

  8. lostash 正则

     (?:\s+?)  0个或者多个空格

  9. Eclipse被汉化后恢复EN模式

    问题描述: 在安装Flush builder 的时候安装了汉化包,导致Eclipse中功能显示为汉字. 问题解决: 在Eclipse快捷方式下“目标”路径中添加-nl "EN"即可 ...

  10. vmware配置安装JDK、Tomcat以及项目部署

    1.安装JDK1.7 JDK:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 安 ...