Running Visual Studio as administrator is needed to host your web project in IIS. Everytime the debugger is started the “Attach Security Warning” confirmation dialog appears. Modify the registry to disable this.
Follow these steps to modify the private registry file (privateregistry.bin):
1. Close Visual Studio 2022. Start regedit.exe and select the node HKEY_USERS
2. In the File menu choose: Load Hive (in dutch: Bestand -> Component laden) and browse to the user Appdata folder.
3. Give the new hive a name.
4. The local registry file is loaded. Go to:
Software\Microsoft\VisualStudio\17.0xxxxx\Debugger\
5. Create a new DWORD key: DisableAttachSecurityWarning and set the value to 1
6. Finally don’t forget to unload the hive and close regedit.
Start Visual Studio 2022 (as Administrator) and the security attach warning is gone when running the debugger attached to the IIS webserver.