When using Visual Studio 2008 or 2010, every time you attach to IIS w3wp.exe you get the Attach Security Warning:
How do you turn this of?
It would be cool to know also, how to keep it attached for longer, as this seems to time out after a while.
Also, I've tried the Microsoft Docs page Security Warning: Attaching to a process owned by an untrusted user can be dangerous, but it didn't work
Also found in the article mentioned by Tzury, but to sum up the answers in this thread:
Make sure Visual Studio is not running when changing the registry key or it will be overwritten on exit with the old value
Visual Studio 2022: Follow these instructions, then reboot.
Visual Studio 2019: Follow these instructions, then reboot.
For older versions of Visual Studio:
Change (or create) the following registry key to 1:
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 might need to create the Registry Key referenced above.
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\Debugger
, right-click and create a new DWORD
:DisableAttachSecurityWarning
1
.Update: If you don't want to open up regedit, save this gist as a *.reg file and run it (imports the keys for all VS versions lower than VS2017).
Visual Studio 2017
The configuration is saved in a private registry location, see this answer: https://stackoverflow.com/a/41122603/67910
For VS 2017+, save this gist as a *.ps1 file and run it as admin, or copy and paste the following code in a ps1 file:
#IMPORTANT: Must be run as admin
New-PSDrive HKU Registry HKEY_USERS
dir $env:LOCALAPPDATA\Microsoft\VisualStudio\*.* | % {
#https://stackoverflow.com/a/41122603
$filePath = "$_\privateregistry.bin"
if (Test-Path $filePath) {
reg load 'HKU\VSPrivateRegistry\' $filePath
$BasePath='HKU:\VSPrivateRegistry\Software\Microsoft\VisualStudio'
if (Test-Path $BasePath) {
$keysResult=dir $BasePath
$keysResult | ? {$_.Name -match '\\\d+\.\d+_[^_]+$'} | % {
$keyName = $_.Name -replace 'HKEY_USERS','HKU:'
Write-Host -ForegroundColor Green "ADDING key to reg path $keyName in file $filePath"
New-ItemProperty -Path $keyName\Debugger -Name DisableAttachSecurityWarning -Value 1
}
$keysResult.Handle.Close()
}
[gc]::collect()
reg unload 'HKU\VSPrivateRegistry'
}
}
Remove-PSDrive HKU