VisualStudio性能查看器无法启动 - 小众知识

VisualStudio性能查看器无法启动

2013年01月27日 14:18:05 苏内容
  标签: VS/日志
阅读:7328

​VisualStudio2019性能查看器无法启动,点击没有反应


Performance profiler failed to launch - Diagnostics session failed to start.

Microsoft Visual Studio cannot start your diagnostics session

Performance profiler failed to launch on any running app , start up project . Both CPU and GPU tools or either of them selected fail.

--Diagnostics Hub log-

Diagnostics session failed to start.

Unable to start Standard Collector. Please try repairing your installation of Visual Studio. (HRESULT: 0xe1110002)​


Hi,

Can you help us diagnose this issue by collecting logs for the Diagnostic tools. Verbose logging can be enabled by running the following commands on an admin command prompt:

reg add HKEY_LOCAL_MACHINESoftwareMicrosoftVisualStudioDiagnosticsHub /v LogLevel /t REG_SZ /d All /reg:32

reg add HKEY_LOCAL_MACHINESoftwareMicrosoftVisualStudioDiagnosticsHub /v LogDirectory /t REG_SZ /d [directory of your choice]/reg:32

After running these commands, start VS, repro your scenario, close VS, then zip up the logs and attach them to this ticket. From here we should be able to better diagnose what is happening. After doing this you can run these commands to disable logging:

reg delete HKEY_LOCAL_MACHINESoftwareMicrosoftVisualStudioDiagnosticsHub /f /v LogLevel /reg:32

reg delete HKEY_LOCAL_MACHINESoftwareMicrosoftVisualStudioDiagnosticsHub /f /v LogDirectory /reg:32

Thanks for helping us build a better Visual Studio.



毫无疑问,Visual Studio可以称得上是一项神作,但是我们偶尔还是会碰到一些问题。那么,你是否知道它带有一个日志开关?官方文档(http://msdn.microsoft.com/en-us/library/ms241272.aspx) 似乎描述得不清不楚,但还好Paul Harrington补充了一条社区评论,算是帮了Visual Studio团队一个大忙。

从本质上来说,其语法如下:


  1. devenv.exe /log [文件名] 

[文件名]是非强制性的,若没有指定文件名,系统默认会将其命名为ActivityLog.xml。下面是日志文件的路径:


  1. %APPDATA%MicrosoftVisualStudio<版本>ActivityLog.xml 

赶紧试一试吧。进入Visual Studio命令提示窗口,输入devenv.exe /log:

 

然后可以导航到文件位置看看。

 

下图是一个示例。打开日志文件后,就会看到如下所示的内容:

 

幸运的是,这是一个带数据的XML样式表(XSL),所以可以通过浏览器查看,其内容一目了然。

 


现在就可以轻松地查看日志信息,寻找问题所在。


扩展阅读