Adding an Uno Platform Project to an existing solution
As of Uno 6.0, the Uno Platform solution templates do not support being included in an existing solution. This known issue can still be worked around by a few manual steps.
In order to add an Uno Platform project to an existing solution:
In a separate temporary folder, create a new project using the Visual Studio 2022 or
dotnet new
templates, usingMyProject
for its name.Copy the generated individual project folders to your solution folder (
MyProject
,MyProject.Server
, etc...)For the
global.json
file:If your solution already contains a
global.json
file, merge themsbuild-sdks
section:"msbuild-sdks": { "Uno.Sdk": "6.0.146" },
If not, copy the entire
global.json
and place it next to your existing sln.
For the
Directory.Build.Props
file, Uno Platform templates use NuGet Central Package Management (CPM) by default, which might conflict with your existing solution.If your solution uses CPM, you'll only need to copy the
ImplicitUsings
andNullable
properties in yourMyProject.csproj
If your solution does not use CPM:
- If you want to start using CPM, you can migrate to use it entirely and copy the contents of Uno's
Directory.Packages.props
to your own version of that file. - If you don't want to use CPM, search for each
PackageReference
in each of Uno's projects and add the versions found in Uno'sDirectory.Packages.props
, if any, as it depends on the options chosen when creating the projects.
- If you want to start using CPM, you can migrate to use it entirely and copy the contents of Uno's
The other files
.vsconfig
,.editorconfig
and.gitignore
are completely optional and can be copied to your solution as needed.Finally, manually add the projects to your solution using right-click on the root, click Add, then Existing Project