码迷,mamicode.com
首页 > 其他好文 > 详细

关于异常Microsoft.CSharp.RuntimeBinder.RuntimeBinderException

时间:2015-09-21 12:00:29      阅读:651      评论:0      收藏:0      [点我收藏+]

标签:

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

标签:

原文地址:http://www.cnblogs.com/lonelyxmas/p/4825593.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!