动态的即时窗口原因“Microsoft.CSharp.RuntimeBinder.Binder”没有定义或导入错误 [英] Dynamic in the immediate window causes 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported error

查看:220
本文介绍了动态的即时窗口原因“Microsoft.CSharp.RuntimeBinder.Binder”没有定义或导入错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我用动态在Visual Studio中的直接窗口,我得到一个错误

If I use dynamic in the immediate window of Visual Studio I get an error

predefined'Microsoft.CSharp.RuntimeBinder.Binder没有定义或导入的类型

Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported

我该如何解决呢?

推荐答案

您应该添加引用Microsoft.CSharp库中选择项目或启动项目研究。和你的项目必须引用的.NET Framework 4或更高版本。

You should add reference to Microsoft.CSharp library in the selected project or in the startup project. And your project should reference .NET Framework 4 or higher.

MSDN有关立即窗口背景:

在确定的范围内进行设计时EX pression评价,   Visual Studio中引用了当前选择的项目解决方案   资源管理器。如果没有项目在解决方案资源管理器中选择,视觉   工作室试图评估对启动项目的功能。   如果该函数不能在当前上下文进行评估,你会   收到一条错误消息。

When establishing the context for design time expression evaluation, Visual Studio references the currently selected project in Solution Explorer. If no project is selected in Solution Explorer, Visual Studio attempts to evaluate the function against the startup project. If the function cannot be evaluated in the current context, you will receive an error message.

这篇关于动态的即时窗口原因“Microsoft.CSharp.RuntimeBinder.Binder”没有定义或导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆