TypeScript 0.8.1的TypeScriptDebugEngine会导致Windows Phone Debug直接crash

今天调试一个Windows Phone 7.1程序,Visual Studio 2012中添加断点就会立刻crash(不加任何断点可以正常运行)。最初以为是偶然现象,反复几次以后查看了详细信息,提示如下:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
   at TypeScriptDebugEngine.TypeScriptInstruction.GetScriptInstructionAddress(Microsoft.VisualStudio.Debugger.DkmInstructionAddress)
   at TypeScriptDebugEngine.SymbolProvider.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmLanguageInstructionDecoder.GetMethodName(Microsoft.VisualStudio.Debugger.Evaluation.DkmLanguageInstructionAddress, Microsoft.VisualStudio.Debugger.Evaluation.DkmVariableInfoFlags)
   at Microsoft.VisualStudio.Debugger.EntryPoint.IDkmLanguageInstructionDecoder_GetMethodName(IntPtr, IntPtr, Microsoft.VisualStudio.Debugger.Evaluation.DkmVariableInfoFlags, IntPtr ByRef)

Microsoft Connect也有人提交了类似的Feedback:http://connect.microsoft.com/VisualStudio/feedback/details/775438/visual-studio-2012-crashes-with-breakpoints-with-windows-phone-apps,从错误的Stack来看应该和TypeScript 0.8.1版本新增的source level debugging有关。

解决方法就是卸载TypeScript 0.8.1版本,如果又想同时使用TypeScript,安装回0.8.0吧。