While debugging you WCF-Service or ASP.NET application within UnitTest you may get following warning when stepping into the service code.
“Attaching to this process can potentially harm your computer…”
For example, this can happen when you have the UnitTest which invokes the Service via generate Proxy instance. When you start the UnitTest method in debugger the Visual Studio will attach VsTest.exe process. However, if you want to step into the service code (by pressing “F11”) the Visual Studio will first have to attach to the process which hosts the service. This might be Cassini or IIS. At this moment you may get following warning:
If you have been doing this for a while you might be surprised that this message sometimes appears and sometimes not. If you have this feeling you are right.
This message will appear if the attaching process which hosts the service is hosted by user which has no debugging permissions. Mostly this just mean it is not the local admin. More precisely, if the host is a process started by IIS (w3wp.exe) the host identity is defined by identity of the pool of the web application which hosts the service.
So, if the pool’s identity has no permission for debugging the message shown above will be popped up. Please be also aware that when working in team you will sometimes be forced to create (next picture) the local directory. In this case IIS will automatically setup the application to default pool, which by default (NETWORK_SERVICE) has no debugging permission.
Posted
Nov 13 2009, 06:12 PM
by
Damir Dobric