-
Notifications
You must be signed in to change notification settings - Fork 65
Build the project
- Visual Studio 2022, with the required workloads.
- For Android, you will need the Android SDK installed as well as Android SDK Platform 30. Simplest way to get this is to install the workload and go to Tools > Android > Android SDK Manager from within Visual Studio.
- For iOS, require Xcode 12.3. Earlier versions won't work.
NOTE: Visual Studio for Mac has support but you need to use the latest 2022 version.
To compile GraphicsControls, you need to be able to compile .NET MAUI apps. You need to download and install Visual Studio 2022 with the following workloads installed:
- Mobile development with .NET
- Universal Windows Platform development
- Desktop development with C++
- .NET Desktop Development
- (Optional) .NET and web development (not mandatory for GraphicsControls but required for Blazor Desktop and the BlazorWebView control)
Next, you must install the Visual Studio extension Single-project MSIX Packaging Tools for VS 2022 to create apps that target Windows UI Library (WinUI) 3. This extension provides Visual Studio 2022 support for working with Windows apps that use Single-project MSIX Packaging.
Once the prerequisites are installed, the last step is installing the .NET MAUI workloads. In a command prompt or terminal, run the following command to install the .NET MAUI workloads
dotnet workload install maui
NOTE: If you have trouble with the dotnet command not being found, then open the Developer Command Prompt for VS 2022 Preview and try it again.
If you want to know if your environment is prepared for .NET MAUI you can use dotnet-maui-check. The dotnet-maui-check utility is a command line tool that verifies your development environment and installs any missing components.
dotnet tool install -g redth.net.MAUI.check
If you already have a previous version of maui-check installed, update it to the latest version with the following:
dotnet tool update -g redth.net.MAUI.check
Run the following command to check your development environment:
maui-check
If any tools and SDKs required by .NET MAUI are missing, maui-check will prompt you to install them. In other case, you are ready now to compile GraphicsControls!.
At this point it is recommended to create a new MAUI project to check your development environment.
dotnet new --install Microsoft.Maui.Templates
Open the GraphicsControls.sln with VS 2022, set GraphicsControls.Sample as started project and press F5.
You can also use the command line:
dotnet build GraphicsControls.Sample -t:Run -f net6.0-android
dotnet build GraphicsControls.Sample -t:Run -f net6.0-ios