views:

27

answers:

1

Is there any way to use the "Run As" option in Windows XP in conjunction with Visual Studio's debugger, to debug an issue that occurs in my application only when certain users are logged in?

I have ran the application from my machine using "run as" to pretend to be the user in question, and I got the same error as they did. I would like to debug this error and see where and what exactly is causing it. The error occurs specifically when a certain domain user is logged in, and never otherwise.

Is there any script or approach I can take to debug this error; that is too launch the application, as the problem user, and then use the debugger?

Trying to attach to the process didn't work since it was a C# managed process and VS didn't let me attach.

A: 

The first two options that come to mind are...

  1. Log onto the machine as the user (simplest approach)
  2. Right-click on the Visual Studio executable and run as that user.

I think that you could edit the .config file to use impoersonation, but I'm not sure if that will result in the app running truly the way it would for the user.

Although with good error handling, the error message itself should be enough to tell you where in the code the problem is... At the very worst, you could compile it in debug mode (so you have all the symbols) and add some global error hanlding and get the exact stack trace...

David Stratton
I will try running VS as the user in question
Tony Peterson