简体   繁体   English

无法在Visual Studio 2017中评估条件断点

[英]Cannot evaluate conditional breakpoint in Visual Studio 2017

I have a really really frustrating error in Visual Studio 2017 我在Visual Studio 2017中有一个非常令人沮丧的错误

I am running code via NUnit tests and get the error below 我正在通过NUnit测试运行代码,并出现以下错误

The condition for a breakpoint failed to execute. 断点的条件无法执行。
The condition was 'value == 22'. 条件是“值== 22”。
The error returned was 'Evaluation of method System.Decimal.op_Equality() calls into native method System.AppDomain.GetId(). 返回的错误是“对本地方法System.AppDomain.GetId()的方法System.Decimal.op_Equality()调用的评估。
Evaluation of native methods in this context is not supported.'. 在这种情况下,不支持对本机方法进行评估。
Click OK to stop at this breakpoint 单击确定以在此断点处停止

Can anyone help please? 有人可以帮忙吗? I have tried with managed compatibility on and off neither work. 我尝试过管理兼容的开关,但都没有用。

If I have managed compatibility off, I can't debug anything at all. 如果我已经关闭了兼容性管理,那么我根本无法调试任何东西。

public decimal MyValue
{
    get => _value;
    set
    {
        if (_value == value)
        {
            return;
        }

    _value = value;
    HasChanged = true;
}

Paul 保罗

There are multiple reports similar to this issue in developer community of visual studio. Visual Studio开发人员社区中有多个与此问题类似的报告。 In one of them it is stated as; 其中之一被描述为:

We have fixed the problem in the upcoming preview of Visual Studio 2019. Thank you for your feedback! 我们已在即将发布的Visual Studio 2019预览版中解决了该问题。感谢您的反馈!

https://developercommunity.visualstudio.com/content/problem/314822/the-condition-for-a-breakpoint-failed-to-execute-e.html https://developercommunity.visualstudio.com/content/problem/314822/the-condition-for-a-breakpoint-failed-to-execute-e.html

https://developercommunity.visualstudio.com/content/problem/377921/evaluation-of-native-methods-in-this-context-is-no.html https://developercommunity.visualstudio.com/content/problem/377921/evaluation-of-native-methods-in-this-context-is-no.html

It looks like this bug in the debugger exists for more than a year 看来调试器中的这个错误已经存在了一年多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM