简体   繁体   English

Visual Studio Community 2015调试器在条件断点处以“不支持本机方法的评估”结束 - 我该如何解决?

[英]Visual Studio Community 2015 debugger ends at conditional breakpoint with “Evaluation of native methods is not supported” - how do I fix?

I have a conditional breakpoint and the condition checks the value of a string and stops if it's true. 我有一个条件断点,条件检查字符串的值,如果是真的则停止。 It stops but then a window opens saying: 它会停止,但随后会打开一个窗口说:

The condition for a breakpoint failed to execute ... The error returned was 'Evaluation of method System.Collections.Specialized.NameValueCollection.get_Item() calls into native method 'System.Globalization.TextInfo.Internal.GetCaseInsHash(). Evaluation of native methods in this context is not supported.'. Click OK to stop at this breakpoint.

I searched for answers but they said enable Managed Compatibility Mode, which didn't work. 我搜索了答案,但他们说启用托管兼容模式,但没有用。

检查项目调试设置下的“启用Visual Studio托管过程”为我解决了这个问题。

You could perhaps also manually add the breakpoint to your code, like so... 你也许也可以手动将断点添加到你的代码中,就像这样......

if (conditionThatMeansStop) 
{
    System.Diagnostics.Debugger.Break();
}

That's how I got around... 这就是我的方式......

Evaluation of method System.String.op_Equality calls into the native method System.Environment.FailFast()

... in a similar situation where I was trying to set a conditional endpoint that checked a string's value. ...在类似的情况下,我试图设置检查字符串值的条件端点。

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

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