更新到 Visual Studio 2015 Update 2 后,在调试 T4 模板期间无法观察变量

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

将 Visual studio 2015 从 VS2015 Update 1 更新到 Update 2 后。在 T4 模板调试期间我无法再观察或检查变量值

如您所见,在当前上下文中找不到监视的变量。这之前在 Visual Studio 2015 更新 1

中有效

这是调试 T4 模板时 visual studio 中的屏幕截图:

我遇到了同样的麻烦。试试这个 "Debug->Options->Debugging:General-> set checkbox on the Use Managed Compatibility Mode".

这看起来像是 Visual Studio 2015 Update 2 中引入的错误。从本质上讲,调试器无法检查动态模块中的局部变量,它可能会导致您看到的行为。我们今天发布了一个修补程序。您可以下载补丁here. Documentation for the patch is here。如果补丁不能解决您的特定情况,请告诉我。

谢谢!

-帕特里克尼尔森