立即窗口,“无法评估表达式....” [英] Immediate Window, "The expression cannot be evaluated...."

查看:414
本文介绍了立即窗口,“无法评估表达式....”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在设计时评估立即窗口中的表达式时,我收到错误:


在设计时无法计算表达式模式。


如果我编译ASP.NET项目并尝试在调试模式下运行它我会收到另一个错误:


在运行模式下无法计算表达式。


为什么我会收到这些错误?我过去使用了立即窗口,即使在设计模式下也能正常工作。

解决方案

假设你没有错过立即窗口中的> 运算符,如果您在多项目解决方案甚至是Web项目中尝试在设计时评估表达式,则可能会出现问题。 / p>

根据 MSDN


如果您正在尝试评估项目中不是
的函数的启动项目解决方案,你收到一个错误,尝试
在解决方案资源管理器中选择项目并再次尝试评估


另外:


您不能在
需要启动执行环境的项目类型中使用设计时表达式评估,包括Visual Studio
工具适用于Offi ce项目,Web项目,智能设备项目和
SQL项目。



When I try to evaluate expression in Immediate Window at design time, I get error:

The expression cannot be evaluated while in design mode.

If I compile ASP.NET project and try to run it in debug mode I get another error:

The expression cannot be evaluated while in run mode.

Why do I get these errors? I have used Immediate Window in the past and it worked fine even in design mode.

解决方案

Assuming that you aren't missing the > operator in the Immediate Window, there could be problems if you are trying to evaluate an expression at design-time in a multi-project solution or even a web project.

According to MSDN:

If you are attempting to evaluate a function in a project that is not the startup project for the solution and you receive an error, try selecting the project in Solution Explorer and attempt the evaluation again.

Also:

You cannot use design time expression evaluation in project types that require starting up an execution environment, including Visual Studio Tools for Office projects, Web projects, Smart Device projects, and SQL projects.

这篇关于立即窗口,“无法评估表达式....”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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