Skip to content

Commit

Permalink
debug, but do not launch my code
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanish-kh committed Feb 20, 2025
1 parent e3bd61b commit eb167c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/Developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ Open `winget-cli\src\AppInstallerCLI.sln` in Visual Studio and build. We current

After the build finishes, deploy the solution from Build > Deploy Solution. You can then run the client from the command line using `wingetdev`.

You can also directly run the client from Visual Studio by setting the `AppInstallerCLIPackage` project as the startup project and pressing <kbd>F5</kbd>. To prevent the client from exiting as soon as it finishes its execution, you can add the `--wait` command line argument in the project's debug settings.

To enable step-through debugging, right click on `AppInstallerCLIPackage` in the Solution Explorer, select Properties, and navigate to the Debug tab. In the Debugger type selection, change "Application process" and "Background task process" to "Native Only". This will allow you to add breakpoints and step through the code. The main entry point for the client is in `src/AppInstallerCLI/main.cpp`

The best way to debug the client is to select `Do not launch, but debug my code when it starts` in the `Debug` tab. You can then use the `wingetdev` command in a terminal session, including PowerShell for COM API interaction, which will get picked up by the debugger.

## Running Unit Tests

The unit tests are located inside the `AppInstallerCLITests` project. When the solution is built, all tests are compiled under `src/<ARCHITECTURE>/<Debug|Release>/AppInstallerCLITests`. An executable `AppInstallerCLITests.exe` is generated in this directory to run the tests. Run `AppInstallerCLITests.exe` from the command line to execute the tests. To see all available options, run `AppInstallerCLITests.exe --help`.
Expand Down

0 comments on commit eb167c7

Please sign in to comment.