Turn off Visual Studio Attach security warnings when debugging IIS

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

  • April 12, 2019

Background information

This small blogpost 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:

Attachment warning
Attachment warning

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.

Change the registry value to ‘1’ for the following keys, depending on your version of Visual Studio.

Visual Studio 2008
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Debugger\DisableAttachSecurityWarning

Visual Studio 2010
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger\DisableAttachSecurityWarning

Visual Studio 2012
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Debugger\DisableAttachSecurityWarning

Visual Studio 2013
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Debugger\DisableAttachSecurityWarning

Visual Studio 2015
HKEY_CURRENT_USER\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 HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\Debugger, right-click and create a new DWORD:

    • Name: DisableAttachSecurityWarning
    • Value: 1.

To make things a bit more easy, you can download a .gist, which you can merge with your registry:

https://gist.github.com/zimplerconsulting/24b87290a89762bd1339ffabf6345e6c#file-securitywarningsvisualstudio-reg


Image Description

Daniel Plomp

Entrepreneur, Senior Software Engineer .NET, Sitefinity Solution specialist, Orchard CMS enthusiast, Product Owner

All Author Posts

Got another minute? Check out:

Image Description

Call us

+31 (0) 36-2000196
Image Description

Email us

mail@zimplerconsulting.com
Image Description

Address

Grote Beer 57, 3893 DJ Zeewolde
NLThe Netherlands

Please sign in

Signin to manage your account.

Do not have an account? Signup

OR