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:
- In a separate temporary folder, create a new project using the Visual Studio 2022 or
dotnet newtemplates, usingMyProjectfor its name. - Unselect all platforms except
Desktopin the platforms selection dialog. - Make sure to select the template preset and features.
- Once the project has been created, navigate to the new folder
MyProject. - Copy
Platforms/Desktopfolder to the existing project structure, at the same level as the other platform folders. - In your
.csproj, add thenet9.0-desktoptarget framework to theTargetFrameworksproperty. - Save your solution.
Your new platform project is now ready to be compiled.
You can repeat a similar process for net9.0-ios, net9.0-android, net9.0-browserwasm, and net9.0-windows10.0.xxxxx.