Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 253
Questioner Avatar asked Sep 19 '17 14:09

Questioner


People also ask

Why does Visual Studio not stop at breakpoint?

This problem occurs because ASP.NET debugging isn't enabled on the application.

How do I add a breakpoint to all methods in visual studio?

Press F3 and then press F9 to add a breakpoint.

How do I set breakpoint conditions in Visual Studio?

Right-click the breakpoint symbol and select Conditions (or press Alt + F9, C). Or hover over the breakpoint symbol, select the Settings icon, and then select Conditions in the Breakpoint Settings window.

What are the ways you can continue debugging from a breakpoint in Visual Studio?

In most languages supported by Visual Studio, you can edit your code in the middle of a debugging session and continue debugging. To use this feature, click into your code with your cursor while paused in the debugger, make edits, and press F5, F10, or F11 to continue debugging.


2 Answers

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

like image 172
Chris Avatar answered Oct 24 '22 02:10

Chris


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.

like image 3
ruffin Avatar answered Oct 24 '22 04:10

ruffin