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

北城以北 提交于 2019-12-08 14:56:13

问题


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.


回答1:


Checking "Enable the Visual Studio hosting process" under project debug settings solved this problem for me.




回答2:


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.



来源:https://stackoverflow.com/questions/46303420/visual-studio-community-2015-debugger-ends-at-conditional-breakpoint-with-evalu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!