debugging - VS2017 条件断点 - "Evaluation of native methods in this context is not supported"

标签 debugging visual-studio-2017 azure-service-fabric conditional-breakpoint

我正在调试 Service Fabric 应用程序,需要使用基于对象 ID 值的条件断点。所以我设置了条件断点,达到的效果

c.id == "43rregfjlh32";

但是,当调试器命中断点时,我收到以下消息:

The condition for a breakpoint failed to execute. The condition was c.id == "43rregfjlh32". The error returned was `Evaluation of method System.String.op_Equality() calls into native method System.Environment.FailFast(). Evaluation of native methods in this context is not supported. Click OK to stop at this breakpoint.

我在网上查看并尝试启用诸如某些帖子中建议的托管兼容模式之类的功能。然而,这不起作用。

最佳答案

这看起来像这个问题:Debugger error when comparing strings (.NET Core) 。根据该页面,该问题已在 Visual Studio 2017 版本 15.9.5 中修复。

我通过使用string.Equals解决了这个问题,例如string.Equals(c.id, "43rregfjlh32")

关于debugging - VS2017 条件断点 - "Evaluation of native methods in this context is not supported",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53138819/

相关文章:

asp.net - 使用 Azure AD 身份验证进行自定义授权

c# - 如何在 Azure Service Fabric ASP.NET Core 有状态服务中获取 PartitionInfo?

azure - Kubernetes + Docker + AWS = Azure + Service Fabric 吗?

javascript - 如何使用 Visual Studio 2017 创建 NPM 包?

c++ - 将 stdout/stderr 重定向到 null vs2017 c++

visual-studio - 在 .NET Core 目标中创建 Azure Function 项目 .NET Framework

debugging - 有什么办法可以在调试期间绕过浏览器 http 超时?

c++ - 声明一个(未使用的)整数导致整个程序出现故障?

c++ - Boost::threads 在调试中工作,在发布时不工作

c++ - 快疯了,为什么我的变量在我身上发生变化?