I use Visual Studio 2017 (15.6.6). When debugging, I try to evaluate simple expressions like int a = 2;
in the immediate window. An error
Internal error in the C# compiler
is thrown.
I tried to enable Use Managed Compatibility Mode
as hinted at in this question but it didn't help.
Thanks for any help.
Searching further I found this issue on GitHub where an answer recommends to also check Use the legacy C# and VB expression evaluators
. Visual Studio gives me a warning about checking this option, but turning this on I can evaluate expressions in the immediate window again.
It is even possible to turn off the Use Managed Compatibility Mode
again.
Update: Notice though that using the legacy expression evaluators prevents me from inspecting local variables at debug time, so I wouldn't call it a solution.
In my case, the problem was occurring in a particular assembly. When we looked at the assembly information, (from the Solution Explorer, right click on project, select Properties, then click on Assemble Information), it was all blank.
So we gave it a Guid, then re-built and it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With