Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to watch variables during debug of T4 templates after updating to Visual Studio 2015 Update 2

After Updating Visual studio 2015 from VS2015 Update 1 to Update 2. I can no longer watch or inspect variable values during T4 template debugging

As you can see, the watched variables are not found in the current context. This was previously working in Visual Studio 2015 update 1

Here is a Screenshot in visual studio while debugging a T4 template:

Screenshot in visual studio while debugging a T4 template

like image 574
wewedroid Avatar asked Mar 13 '23 17:03

wewedroid


2 Answers

I had the same trouble. Try this "Debug->Options->Debugging:General-> set checkbox on the Use Managed Compatibility Mode".

like image 166
bunnyWrote Avatar answered Mar 15 '23 05:03

bunnyWrote


This looks like a bug that was introduced in Visual Studio 2015 Update 2. Essentially the debugger is unable to inspect local variables in dynamic modules and it may be causing the behavior you are seeing. We released a hotfix for it today. You can download the patch here. Documentation for the patch is here. Let me know if the patch does not fix your particular scenario.

Thanks!

-Patrick Nelson

like image 32
Patrick Nelson - MSFT Avatar answered Mar 15 '23 06:03

Patrick Nelson - MSFT