VS debugger not working properly

When I debug an ASP.NET application and run breaks at break point, I cannot read the type variable using Debug Watches. What for? I get an error

 type The name 'type' does not exist in the current context 

The code works fine, the problem is only in debugging, I can not read all the variables during debugging.

 var converterSubClasses = new List<Type>(); GetClassHierarhy(ref converterSubClasses, converterClass); foreach (var type in converterSubClasses) { /* break point here */ var classProperties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); /* skip code */ } 

enter image description here

+4
source share
1 answer

Are you debugging code compiled in Release mode? Depending on the optimizations, the compiler using the type variable does not actually exist. Confirm that you are debugging the compiled Debug code and trying to execute it. (I had cycles that didn't make sense, and entire sections jump when trying to debug in release mode.)

+2
source

All Articles