RunAs A different user when debugging in Visual Studio

后端 未结 7 1039
有刺的猬
有刺的猬 2020-11-29 05:21

I\'m trying to run the program I\'m debugging as a different user. Now, this can be done by running the exe and attaching from Visual Studio, but this is cumbersome.

7条回答
  •  一个人的身影
    2020-11-29 06:09

    As mentioned in have debugger run application as different user (linked above), another extremely simple way to do this which doesn't require any more tools:

    • Hold Shift + right-click to open a new instance of Visual Studio.
    • Click "Run as different user"

    • Enter credentials of the other user in the next pop-up window

    • Open the same solution you are working with

    Now when you debug the solution it will be with the other user's permissions.

    Hint: if you are going to run multiple instances of Visual Studio, change the theme of it (like to "dark") so you can keep track of which one is which easily).

提交回复
热议问题