Skip to main content

Prerequisites

Building WinGet from source requires Windows 10 1809 (17763) or later.

System Requirements

1

Enable Developer Mode

Enable Developer Mode on your Windows machine.
2

Install Visual Studio 2022

Download and install Visual Studio 2022Or use WinGet:
winget install Microsoft.VisualStudio.2022.Community
You may need to adjust workloads via Tools → Get Tools and Features after installation.
3

Install Required Workloads

Install these Visual Studio workloads:
  • .NET Desktop Development
  • Desktop Development with C++
  • Universal Windows Platform Development
Check the .vsconfig file for the complete components list.
4

Install Windows SDK

Install Windows SDK for Windows 11 (10.0.26100)Or use WinGet:
winget install Microsoft.WindowsSDK.10.0.26100
Or via Visual Studio:
  • Go to Tools → Get Tools and Features
  • Select Individual Components
  • Find Windows 10 SDK (10.0.26100.0)
5

Install Visual Studio Extension

Building the Client

1

Clone the Repository

git clone https://github.com/microsoft/winget-cli.git
cd winget-cli
2

Configure Your System

Run the configuration from the project root (so relative paths resolve correctly).Choose based on your Visual Studio edition:
winget configure .config/configuration.winget
3

Integrate vcpkg

Run from Developer Command Prompt or Developer PowerShell for VS 2022:
vcpkg integrate install
This is a one-time setup step until the configuration file is updated to work with vcpkg setup.
4

Build the Solution

Open winget-cli\src\AppInstallerCLI.sln in Visual Studio and build.
Currently only solution-based building is supported. Command-line methods of building a VS solution should also work.

Running and Debugging

Deploy the Solution

After building completes, deploy the solution:
  1. In Visual Studio, go to Build → Deploy Solution
  2. Run the client from command line using:
wingetdev

Enable Step-Through Debugging

1

Configure Debug Settings

  1. Right-click AppInstallerCLIPackage in Solution Explorer
  2. Select Properties
  3. Navigate to the Debug tab
  4. In Debugger type selection:
    • Change “Application process” to “Native Only”
    • Change “Background task process” to “Native Only”
2

Set Breakpoints

The main entry point is in src/AppInstallerCLI/main.cppAdd breakpoints in your code where needed.
3

Start Debugging Session

  1. In the Debug tab, select Do not launch, but debug my code when it starts
  2. Press F5 to start debugging
  3. Use wingetdev command in a terminal session
  4. Your breakpoints will be hit when the code executes
You can also debug PowerShell code for COM API interaction using this method. The debugger will pick up any wingetdev execution.

Running Unit Tests

The unit tests are located in the AppInstallerCLITests project.

Test Location

After building, tests are compiled under:
src/<ARCHITECTURE>/<Debug|Release>/AppInstallerCLITests

Running Tests

cd src/<ARCHITECTURE>/<Debug|Release>/AppInstallerCLITests
.\AppInstallerCLITests.exe
Running specific tests is useful for quick iteration during development. You don’t need to run the entire test suite every time.

Development Workflow

1

Make Code Changes

Edit source files in src/AppInstallerCLI/ or other relevant directories.
2

Build

Build the solution in Visual Studio or use command line:
msbuild src\AppInstallerCLI.sln /p:Configuration=Debug
3

Deploy

Deploy the solution from Visual Studio (Build → Deploy Solution).
4

Test

Run the client using wingetdev or run unit tests to verify your changes.
5

Debug

Use step-through debugging to investigate issues or understand code flow.

Troubleshooting Build Issues

Error: Cannot find Windows SDK 10.0.26100Solution: Install the specific SDK version using WinGet or Visual Studio Installer:
winget install Microsoft.WindowsSDK.10.0.26100
Error: vcpkg not found or integration failedSolution: Ensure you’re running from Developer Command Prompt for VS 2022:
  1. Open Developer Command Prompt from Start menu
  2. Navigate to project directory
  3. Run vcpkg integrate install
Solution: Verify all required workloads are installed:
  1. Open Visual Studio Installer
  2. Click Modify on VS 2022
  3. Ensure “Desktop Development with C++” workload is selected
  4. Check for any pending updates
Solution: Deploy the solution after building:
  1. In Visual Studio: Build → Deploy Solution
  2. Wait for deployment to complete
  3. Try wingetdev again in a new terminal window

Contributing

Once you have a working development environment, you can contribute to the project:
  1. Check open issues for areas to contribute
  2. Follow the contribution guidelines
  3. Submit pull requests with your improvements
Make sure to run tests and verify your changes work correctly before submitting a pull request.

Build docs developers (and LLMs) love