Technical

Turn off Visual Studio Attach security warnings when debugging IIS

This small blog post contains information on how to disable the security warnings when debugging within Visual Studio.

Daniel Plomp

October 20th, 2021

Background information

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.

Change registry settings

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.

  1. Make sure Visual Studio is not running, and open the Registry Editor.

  2. 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:

All rights reserved © ZimplerApps 2021