关于异常Microsoft.CSharp.RuntimeBinder.RuntimeBinderException

原文:关于异常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#.

 

posted on 2015-09-21 11:17 NET未来之路 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lonelyxmas/p/4825593.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值