Debug when issuing another domain account

Is it possible to debug a C # .NET 4 application, perform unit tests, etc., using domain user credentials other than mine? I have several elevated permissions that users and / or service accounts cannot have, and you want to avoid the distortion of my tests and, ultimately, suffer from the β€œit works on my machine” syndrome.

I specifically want to create an SqlConnection object that uses a domain service account, not my own. I must use a domain account and not a SQL Server account to allow SQL Server to emit PEXEC calls to other equipment. (Sounds fun, huh?)

I am surprised at the possibility of running debug / release, since another domain user is no longer configured in the properties panel of the Debug properties of the solution / project. This seems like it would be helpful. Of course, I understand the security risks, but you must admit that this would be very useful in many cases.

Thanks in advance!

+4
source share
1 answer

Possible duplicate of this question ? (Using the VSCommands add-on)

Or this cheap way, from VBForums:

Create your executable file, then using Run As, execute it under the usual user credentials. After it starts, open the VS instance and attach the debugger to it.

+6
source

All Articles