We use cookies to give you the best experience on our website. You can choose which cookies you want to allow below. You can find more details in our privacy policy.
October 20th, 2021
This small blog post contains information on how to disable the security warnings when debugging within Visual Studio.
When you are debugging your web projects in Visual Studio and you are running your websites on IIS, you could get a security warning like this:
This happens when you are attaching your debugger to the w3wp.exe process.
MSDN says the following about the reason this box appears:
"This warning dialog box appears when you attach to a process that contains partially trusted code or is owned by an untrusted user immediately before the attach occurs. An untrusted process that contains malicious code has the potential to damage the computer doing the debugging. If you have reason to distrust the process, then you should click Cancel to prevent debugging."
So of course you should NOT continue reading if you need to have any kind of influence on this process.
To disable these warnings for Visual Studio you should make a change in the registry.
IMPORTANT: make sure that Visual Studio is not running when making the changes to the registry key or it will be overwritten with the old value on exit.
Visual Studio 2008
HKEYCURRENTUSER\Software\Microsoft\VisualStudio\9.0\Debugger\DisableAttachSecurityWarning
Visual Studio 2010
HKEYCURRENTUSER\Software\Microsoft\VisualStudio\10.0\Debugger\DisableAttachSecurityWarning
Visual Studio 2012
HKEYCURRENTUSER\Software\Microsoft\VisualStudio\11.0\Debugger\DisableAttachSecurityWarning
Visual Studio 2013
HKEYCURRENTUSER\Software\Microsoft\VisualStudio\12.0\Debugger\DisableAttachSecurityWarning
Visual Studio 2015
HKEYCURRENTUSER\Software\Microsoft\VisualStudio\14.0\Debugger\DisableAttachSecurityWarning
For VS2015, you need to create the Registry Key referenced above.
Make sure Visual Studio is not running, and open the Registry Editor.
Navigate to HKEYCURRENTUSER\Software\Microsoft\VisualStudio\14.0\Debugger, right-click and create a new DWORD:
Name: DisableAttachSecurityWarning
Value: 1.
To make things a bit easier, you can download a .gist, which you can merge with your registry:
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\VisualStudio\9.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\VisualStudio\10.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\VisualStudio\11.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\VisualStudio\12.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 | |
[HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\VisualStudio\14.0\Debugger] | |
"DisableAttachSecurityWarning"=dword:00000001 |