Adding Platforms to an Existing Project

If you have an existing Uno Platform project, and you have not selected all the platforms you need when creating the project, this guide will show you how to add new ones.

Considering that your project is called MyProject, and you want to add the desktop target support:

  1. In a separate temporary folder, create a new project using the Visual Studio 2022 or dotnet new templates, using MyProject for its name.
  2. Unselect all platforms except Desktop in the platforms selection dialog.
  3. Make sure to select the template preset and features.
  4. Once the project has been created, navigate to the new folder MyProject.
  5. Copy Platforms/Desktop folder to the existing project structure, at the same level as the other platform folders.
  6. In your .csproj, add the net8.0-desktop target framework to the TargetFrameworks property.
  7. Save your solution.

Your new platform project is now ready to be compiled.

You can repeat a similar process for net8.0-ios, net8.0-android, net8.0-maccatalyst, net8.0-browserwasm and net8.0-windows10.0.19041.