Skip to content

Conversation

@jfversluis
Copy link
Member

@jfversluis jfversluis commented Apr 2, 2025

Description of Change

The multi-project template did not take into account the AllPlatforms variable and therefore when using the command-line to create a new project, the project would not include all platforms. This PR fixes that.

Additionally, this adds a tests for this scenario to check if a platform or all platforms are included when created through the command line depending on the provided parameters.

Also, this PR fixes an issue where the Info.plist file was not correctly updated with the XmlEncodedAppName value. Right now it was filled with just the project name that you would generate. If the project would contain special characters that are not compatible with XML (which the Info.plist file is), then the build would fail. For example, create a .NET MAUI project with the name MultiProject@Symbol & More, would result in an Info.plist node of that same value, which is not valid XML. With this change, the MultiProject@Symbol & More project name value is XML encoded and then replaced in the Info.plist file.

The reported issue mentions .NET 10 where this was not working, but this is also not working for .NET 9.

Issues Fixed

Fixes #28695

@jfversluis jfversluis added the area-templates Project templates, Item Templates for Blazor and MAUI label Apr 2, 2025
@jfversluis jfversluis added this to the .NET 9 SR7 milestone Apr 2, 2025
Copilot AI review requested due to automatic review settings April 2, 2025 14:43
@jfversluis jfversluis requested a review from a team as a code owner April 2, 2025 14:43
@jfversluis jfversluis requested review from PureWeen and rmarinho April 2, 2025 14:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the multi-project template to correctly include all platforms when the AllPlatforms variable is used, and it adds/updates tests to verify this behavior.

  • Replaces test cases for Windows and macOS with WinUI and MacCatalyst for single platform builds.
  • Introduces a new test (VerifyIncludedPlatformsInSln) to confirm that all expected platform projects are included when no platform argument is provided.
Files not reviewed (1)
  • src/Templates/src/templates/maui-multiproject/MauiApp.1.sln: Language not supported

@jfversluis

This comment was marked as outdated.

@rmarinho rmarinho moved this from Todo to Ready To Review in MAUI SDK Ongoing Apr 9, 2025
@jfversluis jfversluis enabled auto-merge (squash) April 15, 2025 15:06
@PureWeen PureWeen modified the milestones: .NET 9 SR7, .NET 9 SR8 May 8, 2025
@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing May 14, 2025
@jfversluis jfversluis merged commit e798a87 into main May 14, 2025
128 checks passed
@jfversluis jfversluis deleted the fix-28695 branch May 14, 2025 00:57
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing May 14, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-templates Project templates, Item Templates for Blazor and MAUI

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.NET MAUI Multi-Project sln only includes shared project when created using CLI

4 participants