Debugging C++ Code on Linux using WSL and Visual Studio 2022 - Specifying Command Line Arguments

David Stidolph 20 Reputation points
2023-05-08T12:02:13.8266667+00:00

I am building command line apps for both Windows and Linux. I am using a Windows computer and Visual Studio 2022. When developing for Windows I can specify command line arguments for debugging by Right-Clicking on the project and going to the Debug tab - how do I do this for Linux? I can debug by pressing F5 and it copy's/builds/runs as a Linux program, but I need to specify test arguments!

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,643 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 25,891 Reputation points Microsoft Vendor
    2023-05-08T14:04:41.28+00:00

    Hi @David Stidolph

    Welcome to Microsoft Q&A! 

    You can specify the "args" property in the Launch.vs.json file.

    For more details, you can refer to: Configure CMake debugging sessions

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful