c# - Visual Studio Immediate window "Internal error in the expression evaluator" -


disclaimer: checked this question immediate window.

i'm using entity framework fetch results, have list of logging:

var result = ctx.logging.where(*filtering*).tolist(); 

but want know distinct datatypes of list (an enumeration, underlying type byte , datatype nullable, if make not nullable works reason). when try in immediate window:

result.select(r => r.datatype).distinct().tolist(); 

i message:

internal error in expression evaluator.

however works fine when in code, example var test = result.select(r => r.datatype).distinct().tolist();. tried using 'managed compatibility mode' , 'legacy expressions' debugging options message:

expression cannot contain lambda expressions

am missing or bug in visual studio 2015?

minimal, complete, , verifiable example:

class program {     static void main(string[] args)     {         list<test> tests = new list<test>();         for(int = 0; i<100; i++)         {             if (i % 2 == 0)                 tests.add(new test { id = i, enum = testenum.value1 });             else                 tests.add(new test { id = i, enum = testenum.value2 });         }         var distinct = tests.select(t => t.enum).distinct().tolist();     } }  public enum testenum : byte {     value1 = 1,     value2 = 2 } public class test {     public int id { get; set; }     public testenum? enum { get; set; } } 

in code tests.select(t => t.enum).distinct().tolist(); works, in immediate window doesn't.

i think bug in expression evaluator seems work workaround this:

tests.select(t => t.enum).tolist().distinct().tolist() 

here same result using this:

? tests.select(t => t.enum).tolist().distinct().tolist() count = 2     [0]: value1     [1]: value2 

i noticed 'quickwatching' expression in code results in error:

internal error in expression evaluator. 

at least consistent in area :-)


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -