Debugger does not attach automatically in Visual studio

Getting the following error,

----------------------------
Microsoft Development Environment
---------------------------
Error while trying to run project: Unable to start debugging on the web server. You do not have permissions to debug the server. Verify that you are a member of the 'Debugger Users' group on the server.
---------------------------
OK Help
---------------------------

On running without debugging get a configuration error,

<add assembly="*"/>
Access denied on <File(s) present in the bin folder>

Why does this happen?

The site is added to one of the zones (Internet,Trusted sites, Restricted sites) in IE. And in IE settings Tools ->Internet Options -> Security -> <Zone> -> Custom level -> user authentication -> Logon is set to ‘Automatic Logon only in Intranet zone’. Due to this configuration, IE would not pass the logged on users credentials to visual studio. So Visual Studio is not able to copy files to temporary ASP.NET files folder.

How to fix it?

Change the security settings for IE Tools ->Internet Options -> Security -> <Zone> -> Custom level ->user authentication ->Logon and make it ‘Automatic Logon with current user name and password’.

Hope this helped you in some way