Wednesday, November 02, 2005

Cannot debug with VS.NET 2003?

Suddenly, I could not debug anything at all in VS.NET 2003. Not Web Projects, not simple C# applications, not anything.

The error was Unable to start debugging. Access is denied. And then a rambling of "make sure that You are a member of Debugger Users group or Administrator". But I was member of both groups.

Lots of googling later, I found the answer: it appeared that the Machine Debug Manager service (a process that helps he debugger to locate and attach to other processes and runs as a service) for some reason had stopped working. The service seemed to be running OK when I looked in Services, but I had an entry in the Event log that made me think otherwise:

Event 10023, Source COM:
The application-specific access security descriptor for the COM Server application C:\Program Files\Common Files\Microsoft Shared\VS7Debug\mdm.exe is invalid. It contains Access Control Entries with permissions that are invalid. The requested action was therefore not performed. The application set this security permission programmatically; to modify this security permission contact the application vendor.

A bit more googling and I found a solution:
  1. Stop the Machine Debug Manager Service.
  2. reregister the mdm.exe COM server by entering mdm.exe /regserver at the command line
  3. Start the Machine Debug Manager Service again.
  4. Voila! Debugging works.
The only thing that bugs me right now is that I do not know what caused it to stop working since I suspect that it will happen again at the worst possible time.

No comments: