Ever since we upgraded to Windows 7 some people have experienced problems when trying to attach Visual Studios debugger to IIS. Up until this weekend it hadn’t happened to me, but when I started my local SQL server to work on a locally hosted project during the weekend I got this error message:
![Unable to attach to the process. Access is denied. Unable to attach to the process. Access is denied.](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tdvhPbtoiCy5-3ZXIiJ_zRzRjqQtGtMuFOEmsq-w0vHnDVamsqQaBVJRtPjhgMLrSKVLNuR06ik67NDwKcq8BC4RKt82zOSCn-znHpIly5yajC8ZcLCtIzpYIME9dfKZDN4aLjpI_DyeJhSuNcTMCoCKvMm220H2ugFlKlm_AOzA=s0-d)
Turns out Visual Studio doesn’t automatically figure out that I want to debug managed of code when the process runs several types of code. Telling it what type of code to debug, managed, fixes the problem.
In the Attach to Process dialog, under the “Attach to” heading click select.
Click the “Debug these code types” radio button and select “Managed”. Hit OK and the problem is solved.
![managed managed](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tzffY0Z9YwIuDpPRpOIcBU2N08iH0MxFcVmeK4mxcqQaad2gp_rl-t6NCeQ1GAPO-rvIsBEdHOc3ecNN4J9p6bsR6KoEVCg54n-D0JiD9MSLIvh9z2n8KzYqeTi9oMkZE2uNqlUweDlMbDloqtLnR2_KSzqoiAR4Y9w2-rGWLCxQ=s0-d)
Turns out Visual Studio doesn’t automatically figure out that I want to debug managed of code when the process runs several types of code. Telling it what type of code to debug, managed, fixes the problem.
In the Attach to Process dialog, under the “Attach to” heading click select.
Click the “Debug these code types” radio button and select “Managed”. Hit OK and the problem is solved.