原文:关于异常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. Android studio checkstyle 使用

    首先要安装CheckStyle-IDEA插件,官网:https://plugins.jetbrains.com/plugin/1065 打开Android studio进入设置->Plugins ...

  2. MySQL高效获取记录总数

    通常mysql获取查询记录总数我们使用如下语句: SELECT COUNT(*) FROM users WHERE k='avs';  或:SELECT id FROM goods WHERE k=' ...

  3. linux case 语句

    #!/bin/bash #$ 表示脚本名 #$n 表示第n个参数(n>) in ") echo '--=> A' ;; ") echo '--=> B' ;; * ...

  4. SQL Server 内存开销分析

    第一步: 每一类资源用了多少内存. select          clerks.type,         sum(clerks.virtual_memory_reserved_kb) as Res ...

  5. JavaScript学习笔记:数组reduce()和reduceRight()方法

    很多时候需要累加数组项的得到一个值(比如说求和).如果你碰到一个类似的问题,你想到的方法是什么呢?会不会和我一样,想到的就是使用for或while循环,对数组进行迭代,依次将他们的值加起来.比如: v ...

  6. 关于listener

    View.OnKeyListener |_____onKey(View v, int keyCode, KeyEvent event) View.OnTouchListener |_____onTou ...

  7. BCB的博客,以及例子(好多传输文件的例子)

    http://blog.csdn.net/keyu1711/ http://download.csdn.net/user/keyu1711 http://download.csdn.net/user/ ...

  8. Linux中Samba详细安装

    为了实现Windows主机与Linux服务器之间的资源共享,Linux操作系统提供了Samba服务,Samba服务为两种不同的操作系统架起了一座桥梁,使Linux系统和Windows系统之间能够实现互 ...

  9. poj 1573 Robot Motion_模拟

    又是被自己的方向搞混了 题意:走出去和遇到之前走过的就输出. #include <cstdlib> #include <iostream> #include<cstdio ...

  10. Xcode7 使用NSURLSession发送HTTP请求报错

    http://blog.csdn.net/chenyong05314/article/details/46721205