简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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