0

I need to debug run a C# project using a different user. I found this link, However, it's old.

How do you debug a project as a different user in Visual Studio 2022?

The Launch Profiles doesn't have the executable field. Launch Profiles

ca9163d9
  • 27,283
  • 64
  • 210
  • 413
  • Does this answer your question? [RunAs A different user when debugging in Visual Studio](https://stackoverflow.com/questions/1287099/runas-a-different-user-when-debugging-in-visual-studio) – shingo Dec 19 '22 at 05:59
  • No, I want to using the approach of the link, for visual studio 2022. – ca9163d9 Dec 19 '22 at 07:33

1 Answers1

2

If you mean how to using the approach for a .net core project, here is the steps:

  1. Click the downward arrow in the picture and choose "<project> Debug Properties".

Step1

  1. In the dialog click the first button and choose "Executable".

Step2

  1. Input the executable and arguments.

  2. Select the new profile (in the first picture) and start debugging.

  3. Note that with this approach you still need attach to the process, see the comments in this answer: https://stackoverflow.com/a/1287221/6196568

shingo
  • 18,436
  • 5
  • 23
  • 42
  • I didn't see the first field in my Visual Studio 2022. It starts with `Command line arguments` in my Visual Studio? – ca9163d9 Dec 19 '22 at 14:27
  • You need create a new **Executable** profile, a Project profile starts with "Command line arguments" – shingo Dec 20 '22 at 05:04