Microsoft.CSharp.RuntimeBinder.Binder未定义

.Net技术 码拜 9年前 (2015-02-07) 3449次浏览 0个评论

在VS2012中编译代码时,提示“ 预定义的类型Microsoft.CSharp.RuntimeBinder.Binder未定义 或未定义 ”,而在VS2010中时正常。出现异常的代码环境:

使用如下代码获取webBrowser中的图片时,需要引用Microsoft.mshtml.dll程序集,

 

HTMLDocument doc = (HTMLDocument)webBrowser.Document.DomDocument;
HTMLBody body = (HTMLBody)doc.body;
IHTMLControlRange rang = (IHTMLControlRange)body.createControlRange();
IHTMLControlElement img;

查找原因发现,VS2010中自动引用了Microsoft.CSharp,而VS2012中没有自动引用,添加Microsoft.CSharp引用后,编译正常。Microsoft.CSharp.RuntimeBinder.Binder未定义

 


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Microsoft.CSharp.RuntimeBinder.Binder未定义
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!