关于异常Microsoft.CSharp.RuntimeBinder.RuntimeBinderException

简介: 关于Microsoft.CSharp.RuntimeBinder.RuntimeBinderException的异常一般来自于两种, 第一种: Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported 解决它的办法是,直接在项目引用中添加 Micorsoft.Csharp 就可以了。

关于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")]

使用第二种方法后,匿名类型可以传递到目标程序集。

微信扫一扫,关注最课程(www.zuikc.com),获取更多我的文章,获取软件开发每日一练

Creative Commons License本文基于 Creative Commons Attribution 2.5 China Mainland License发布,欢迎转载,演绎或用于商业目的,但是必须保留本文的署名 http://www.cnblogs.com/luminji(包含链接)。如您有任何疑问或者授权方面的协商,请给我留言。
目录
相关文章
|
Windows BI
未能加载文件或程序集 Microsoft.ReportViewer.Common, Version=11.0.0.0
原文: 未能加载文件或程序集 Microsoft.ReportViewer.Common, Version=11.0.0.0 System.IO.FileNotFoundException: 未能加载文件或程序集“Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91”或它的某一个依赖项。
1536 0
|
BI C++ Windows
RDLC报表 在WinForm里运行出现 未能加载文件或程序集 Microsoft.ReportViewer.WinForms, Version=11.0.0.0 System.IO.FileNotFoundException
原文:RDLC报表 在WinForm里运行出现 未能加载文件或程序集microsoft.reportviewer.winforms 推荐以下方案二 做一下记录顺便帮助一下遇到问题的朋友。 做RDLC报表在WinForm运行,在VS里面调试引用了“Microsoft.ReportViewer.Common.dll”和“Microsoft.ReportViewer.WinForms.dll”调试运行的时候没有问题。
1712 0
|
Windows
了解GAC:从“找不到Microsoft.SqlServer.SqlClrProvider.dll”的问题开始
了解GAC:从“找不到Microsoft.SqlServer.SqlClrProvider.dll”的问题开始                             老帅    先上图,看真相,如下: 一、问题描述    我使用Microsoft.SqlServer.Smo开发了一个数据库管理工具,根据定制的需求,完成对SQLServer的管理。
1259 0
|
Windows 编译器 .NET
编译器错误信息:CS0016:未能写入输出文件 c:\WINDOWS\Microsoft.NET\Framework\...的解决办法
今天在向服务器部署一个fluorineFx web应用时,浏览站点总出现这个错误,用aspnet_regiis.exe -i注册,把c:\windows\temp,c:\windows\tmp,C:\Windows\Microsoft.
1180 0
|
Windows
解决方法:未能加载文件或程序集“Microsoft.Office.Interop.Excel。。
.NET错误提示:未能加载文件或程序集“Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”或它的某一个依赖项。
2394 0

热门文章

最新文章