Configuring Windows XP to Allow Non-Administrators to Debug ASP.Net

December 18, 2008 23:43 by Admin

Just a quick post after I’ve spent a merry afternoon trying to configure a Windows XP machine to allow a developer, who hasn’t got Local Administrator rights, to debug an ASP.Net application. This is a subject covered elsewhere including on the MSDN site.

What you basically need to do is have the ASP.Net worker process run as the developer. Then he can attach a debugger to the running process with no problems at all. The MSDN “How to: Run aspnet_wp.exe Under a User Account” page describes how to do this. One point it doesn’t cover is exactly what change to make to the processModel element. Here is my before and after for the element if you ever have to do this:

<!-- Before: -->

<processmodel autoconfig="true" />

<!-- After: -->

<processmodel autoconfig="true" password="”XYZ”" userName="”DOMAIN\DevUserName”" />

Unfortunately, I still had problems after following the steps on that page.

First off, ASP.Net fell over as soon as the first request hit the server. It gave the error:

Failed to access IIS metabase

I guessed the worker process (now running as the developer) was not able to access all the directories it needed to. But which directories did I have to change the security on? I eventually came across a flag for aspnet_regiis that did the job:

aspnet_regiis –ga DOMAIN\DevUserName

After running aspnet_regiis the worker process seemed to get a bit further, but then complained that it couldn’t write to a file under the “Temporary ASP.Net Files” directory, despite me giving the developer Full Control of the directory. I deleted the entire contents of the directory, it is just a cache after all. Then ASP.Net seemed happy to run as the developer. Sure enough, the developer was then able to log on and debug an ASP.Net application.

I didn’t go as far as storing the username and password securely in the registry… that’s a task for another day… but the processModel Element page on MSDN explains the process.

I hope this saves somebody some time in the future.


Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading