-
Notifications
You must be signed in to change notification settings - Fork 135
Getting started
To get started with the Windows Community Toolkit, you can follow these steps:
git clone --recurse-submodules https://github.com/CommunityToolkit/Windows.git
The folder will contain a tooling and components folder. The latter contains all the individual Toolkit components.
Run the following script to navigate to the cloned folder, install SlnGen and run GenerateAllSolutions.bat.
cd *path of your Toolkit folder*
dotnet tool restore
.\GenerateAllSolution.bat
This will generate and open the CommunityToolkit.AllComponents.sln. In Visual Studio, select the preferred startup project (Uwp (WinUI2), WinAppSDK (WinUI3) or Wasm (Uno).

To create a new component run the following script:
cd *path of your Toolkit folder*
dotnet new --install .\tooling\ProjectTemplate\
cd components
dotnet new ctk-component -n MyExperimentNameHere
This will generate a new component folder that contains src, samples and tests folders.
In an existing component folder, you can run OpenSolution.bat to generate the .sln:
cd *path of your component*
.\OpenSolution.bat
The .sln` will open automatically, and contains the a source project (component code), samples project (samples and documentation) and tests project (for all tests).

You can test your component code by adding it to a sample, and use the different startup projects to test it on UWP, WinAppSDK or Uno.
Errors that might come up when running the .bat files:
Make sure you set the execution policy. (More info: https://lazyadmin.nl/powershell/running-scripts-is-disabled-on-this-system/)
Error: Could not find a Visual Studio installation. Please run from a command window that has MSBuild.exe on the PATH or specify the full path to devenv.exe via the -vs command-line argument
Use Developer Command Prompt for VS2022, or add msbuild.exe to your PATH variables to use it in e.g. PowerShell. (More info: https://stackoverflow.com/a/12608705)

- Home ๐
- Welcome ๐
- Principles โ๏ธ
- Roadmap ๐บ
- .NET Foundation
- Why Microsoft supports this project
- License ๐
- Getting Started ๐
- Sample App ๐ฑ
- NuGet Packages ๐ฆ
- Preview Packages ๐
- Toolkit Labs ๐งช
- Questions โ
- Discussions ๐ฅ
- Submitting an Issue โ๏ธ
- Good First Issue ๐
- Help Wanted ๐
- Bug Fixes ๐
- Feature Requests ๐ซ
- Component Quality Evaluation ๐ฎ
- Create and Submit PullRequest ๐
- Documentation ๐
- Review PR ๐
- Avoid Roadblocks ๐ง
- Required Dependencies ๐
- Quick Start โก
- Sample Development ๐ฑ
- Testing ๐งช
- Accessibility Guideline โฟ
- Coding Style and Conventions โ
- Building XAML Controls ๐
- CI and Infrastructure ๐พ
- Updating ToolkitLabs.dev ๐
- Migration Guide from v7 to v8 ๐
- How the Project is Organized ๐๏ธ
- Join the Toolkit Organization ๐ช
- Hall of Fame ๐