Get "Internal error in the expression evaluator" on "Add watch" function when trying to debug WCF service code (MSVS 2013)

Ceridan picture Ceridan · Feb 18, 2014 · Viewed 32.9k times · Source

Few days ago I moved my solution to MSVS 2013. It works fine except one thing: when I trying to debug code of my WCF service it works, but when I want to watch state of any variable it says: "Internal error in the expression evaluator". Add watch function works normal on client side, but in service code it broken. I'm trying to debug my own WCF service running on the localhost. Could you help me, how to repair this?

enter image description here

Here MSVS info: Microsoft Visual Studio Professional 2013 Version 12.0.30110.00 Update 1 Microsoft .NET Framework Version 4.5.51641 OS: Windows 8.1

Answer

Igal Tabachnik picture Igal Tabachnik · Mar 23, 2014

This might be a bug in the new (managed) debug engine that ships with Visual Studio 2013. Try turning on Managed Compatibility Mode (which effectively turns it into pre-2013 debug engine), located under Tools - Options - Debugging:

If this solves the issue, then I'd suggest trying to reproduce it with a small project, and then reporting it on Connect, so it could be fixed.

@bjhuffine comments below that there are other ways to enable compatibility mode, without globally disabling it (e.g. per-project). More information here: https://devblogs.microsoft.com/devops/switching-to-managed-compatibility-mode-in-visual-studio-2013/