如何从 Visual Studio 禁用 Perfwatson2.exe

问题描述 投票:0回答:3

如何在 Visual Studio 中禁用 Perfwatson? Perfwatson 不会被通过工具 > 扩展和更新 > 开发人员分析工具禁用。

visual-studio visual-studio-2017
3个回答
653
投票

对于 Visual Studio 2022 和最新版本的 Visual Studio 2019:

  1. 从帮助菜单中,选择隐私 > 隐私设置
  2. Visual Studio 体验改进计划 对话框中,选择 不,我不想参与。

注意:您无法通过此机制选择退出预发布版本。

对于旧版本的 Visual Studio

  1. 从帮助菜单中,选择发送反馈 > 设置
  2. Visual Studio 体验改进计划 对话框中,选择 不,我不想参与。

请参阅 Visual Studio 客户体验改善计划,了解 Microsoft 官方说明。

此更改写入注册表。请参阅下一个答案以直接在注册表中修复。


31
投票

您可以通过注册表来完成。对于 64 位操作系统,密钥位于

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\15.0\SQM 

对于 32 位操作系统,请访问:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\15.0\SQM 

对于组策略管理(IT 部门的设置),它是

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\VisualStudio\SQM

按键名称为

OptIn
(a
DWORD
),需要将其设置为0才能禁用。

来源:https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-experience-improvement-program

自动设置

(在不受组策略管理的 64 位操作系统计算机上),启动管理命令提示符,然后

REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\15.0\SQM  /v OptIn /t REG_DWORD /d 0 /f

您可能必须关闭并重新启动所有与 Visual Studio 相关的进程(或重新启动)才能使更改生效。


0
投票

微软似乎在这里遵循一贯的路线。如果您对 VS 多个版本的补丁感兴趣,这里有现成的补丁。将内容复制到记事本中,另存为*.reg文件并执行。

Windows Registry Editor Version 5.00

; Visual Studio uses PerfWatson2.exe to track the app behavior by default.
; Annoying: Each time closing a VS project it lasts about additional 1 minute for Visual Studio to close it.
; Until then you aren't able to delete/edit the source files and in general VS acts very slow with it!
; With this patch it bans PerfWatson2.exe for the sake of privacy matters and extreme much better workflow.
; Should work for Visual Studio 2017, 2019, 2022 (both x86 and x64)

; Visual Studio 2017
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\15.0\SQM]
"OptIn"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\15.0\SQM]
"OptIn"=dword:00000000

; Visual Studio 2019
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\16.0\SQM]
"OptIn"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\16.0\SQM]
"OptIn"=dword:00000000

; Visual Studio 2022
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\17.0\SQM]
"OptIn"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\17.0\SQM]
"OptIn"=dword:00000000

我可以非常大胆地想象,对于下一个版本 VS 2024,我们能够向前修补它,添加一个带有数字 +1 = 18.0 的条目,如果微软继续他们自己的逻辑的话):

; Likely Future - no guarantee here:
; Visual Studio 2024
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\18.0\SQM]
"OptIn"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\18.0\SQM]
"OptIn"=dword:00000000
© www.soinside.com 2019 - 2024. All rights reserved.