How do I disable Perfwatson in Visual Studio? Perfwatson is not disabled by Tools > Extensions and Updates > Developer Analytics Tools.
ACCEPTED]
For Visual Studio 2022 and the latest version of Visual Studio 2019:
Note: You can't opt out in pre-release versions by this mechanism.
For older versions of Visual Studio
Pressing OK on the dialog will need elevated privileges, and you have to restart the computer for the changes to take effect.
See Visual Studio Customer Experience Improvement Program [1] for the official Microsoft instructions.
This change writes to the registry. See then next answer for fixing directly in the registry.
[1] https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-experience-improvement-programYou can do it via the registry. For a 64 bit OS, the key is at
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\15.0\SQM
And for a 32 bit OS, at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\15.0\SQM
For Group Policy management (settings from IT department), it's
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\VisualStudio\SQM
The key name is OptIn (a DWORD), and you need to set it to 0 to disable.
Source: https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-experience-improvement-program
(On a 64 bit OS machine not managed by a group policy), fire up an admin command prompt and just
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\15.0\SQM /v OptIn /t REG_DWORD /d 0 /f
You may have to close and restart all visual studio related processes (or reboot) for the change to bite.
Seems like Microsoft follows a constant line here. Whoever is interested in the patch for several versions of VS, here comes the ready patch. Copy the content into notepad, save it as *.reg file and execute.
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
Would being very bold I could imagine for the next version VS 2024 us of able to patch it forward in adding an entry with number +1 = 18.0, if Microsoft would continue their own logic):
; 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
devenv.exeis terminated on exit. But not this child process calledPerfWatson2.exe. Now that I have disabled this option, it no longer starts with Visual Studio, and when I exit out of Visual Studio I can easily delete the folder. So thank you for sharing this tip! - Samir