zoukankan      html  css  js  c++  java
  • 关于异常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#.

  • 相关阅读:
    shell_02
    shell_practise
    Shell_01
    PythonDay_03
    PythonDay_02
    PythonDay_01
    面试题32:从上到下打印二叉树
    面试题 31 : 栈的压入、弹出序列
    面试题20 : 表示数值的字符串
    面试题29:顺时针打印矩阵
  • 原文地址:https://www.cnblogs.com/deepalley/p/14685166.html
Copyright © 2011-2022 走看看