Repository navigation
[Templates] Align framework selection with Android and MAUI - #26849
jonathanpeppers wants to merge 3 commits into
Conversation
Match dotnet/android#13119 by mapping Framework to --framework and -f. Add framework choices to the four Apple test templates and cover generation for all project-template variants. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 284c6980-1fc2-4171-8d57-7ea26e0b7330
There was a problem hiding this comment.
🟡 Changes recommended
The regression tests derive expected frameworks from the configuration under test and therefore cannot detect removed choices or changed defaults.
1 open finding
What changed in this PR
Aligns Apple project templates with Android/MAUI framework-selection behavior.
Changes:
- Adds
--framework/-fmappings to all 28 project-template variants. - Adds .NET 11/.NET 10 selection to four test templates.
- Adds framework generation regression tests and CLI argument support.
| File | Description |
|---|---|
tests/dotnet/UnitTests/TemplateTest.cs |
Adds framework-generation tests. |
tests/common/DotNet.cs |
Supports extra dotnet new arguments. |
dotnet/Templates/Microsoft.tvOS.Templates/tvostest/csharp/.template.config/template.json |
Adds test-template framework choices. |
dotnet/Templates/Microsoft.tvOS.Templates/tvostest/csharp/.template.config/localize/templatestrings.en.json |
Localizes framework choices. |
dotnet/Templates/Microsoft.tvOS.Templates/tvostest/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.tvOS.Templates/tvoslib/visualbasic/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.tvOS.Templates/tvoslib/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.tvOS.Templates/tvosbinding/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.tvOS.Templates/tvos/visualbasic/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.tvOS.Templates/tvos/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.macOS.Templates/macostest/csharp/.template.config/template.json |
Adds test-template framework choices. |
dotnet/Templates/Microsoft.macOS.Templates/macostest/csharp/.template.config/localize/templatestrings.en.json |
Localizes framework choices. |
dotnet/Templates/Microsoft.macOS.Templates/macostest/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.macOS.Templates/macoslib/visualbasic/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.macOS.Templates/macoslib/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.macOS.Templates/macosbinding/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.macOS.Templates/macos/visualbasic/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.macOS.Templates/macos/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalysttest/csharp/.template.config/template.json |
Adds test-template framework choices. |
dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalysttest/csharp/.template.config/localize/templatestrings.en.json |
Localizes framework choices. |
dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalysttest/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalystlib/visualbasic/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalystlib/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalystbinding/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalyst/visualbasic/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalyst/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/iostest/csharp/.template.config/template.json |
Adds test-template framework choices. |
dotnet/Templates/Microsoft.iOS.Templates/iostest/csharp/.template.config/localize/templatestrings.en.json |
Localizes framework choices. |
dotnet/Templates/Microsoft.iOS.Templates/iostest/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/ioslib/visualbasic/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/ioslib/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/iosbinding/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/ios/visualbasic/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/ios/fsharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/ios/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/ios-tabbed/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/ios-notification-service-extension/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
dotnet/Templates/Microsoft.iOS.Templates/ios-notification-content-extension/csharp/.template.config/dotnetcli.host.json |
Maps framework CLI options. |
🧠 Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The 52 non-English catalog edits contradict the stated English-only localization scope and should be removed.
53 open findings
Remove untranslated English entries from Czech catalog · New Remove untranslated English entries from German catalog · New Remove untranslated English entries from Spanish catalog · New Remove untranslated English entries from French catalog · New Remove untranslated English entries from Italian catalog · New Remove untranslated English entries from Japanese catalog · New Remove untranslated English entries from Korean catalog · New Remove untranslated English entries from Polish catalog · New Remove untranslated English entries from Brazilian Portuguese catalog · New Remove untranslated English entries from Russian catalog · New Remove untranslated English entries from Turkish catalog · New Remove untranslated English entries from Simplified Chinese catalog · New Remove untranslated English entries from Traditional Chinese catalog · New Remove untranslated English entries from Czech catalog · New Remove untranslated English entries from German catalog · New Remove untranslated English entries from Spanish catalog · New Remove untranslated English entries from French catalog · New Remove untranslated English entries from Italian catalog · New Remove untranslated English entries from Japanese catalog · New Remove untranslated English entries from Korean catalog · New
And 33 more that still need to be addressed.
🧠 Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #422e6f7] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 3 tests failed, 218 tests passed. Failures❌ dotnettests tests (iOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (macOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (iOS)1 tests failed, 19 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
|
There was a problem hiding this comment.
🟢 Approval recommended
The framework mappings, test-template choices, and regression coverage are consistent across all 28 variants.
0 open findings
53 resolved since last review
Remove untranslated English entries from Traditional Chinese catalog Remove untranslated English entries from Simplified Chinese catalog Remove untranslated English entries from Turkish catalog Remove untranslated English entries from Russian catalog Remove untranslated English entries from Brazilian Portuguese catalog Remove untranslated English entries from Polish catalog Remove untranslated English entries from Korean catalog Remove untranslated English entries from Japanese catalog Remove untranslated English entries from Italian catalog Remove untranslated English entries from French catalog Remove untranslated English entries from Spanish catalog Remove untranslated English entries from German catalog Remove untranslated English entries from Czech catalog Remove untranslated English entries from Traditional Chinese catalog Remove untranslated English entries from Simplified Chinese catalog Remove untranslated English entries from Turkish catalog Remove untranslated English entries from Russian catalog Remove untranslated English entries from Brazilian Portuguese catalog Remove untranslated English entries from Polish catalog Remove untranslated English entries from Korean catalog
And 33 more resolved.
🧠 Review effort: Balanced
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |

Summary
Align Apple project-template framework selection with dotnet/android#13119 and the corresponding MAUI template CLI behavior.
Frameworksymbol to--frameworkand-fin all 28 project-template variants, including C#, F#, and Visual Basic where available, notification extensions, and the tabbed application.iostest,tvostest,macostest, andmaccatalysttest.What was not aligned
Apple templates: None of the project templates had a CLI host mapping for
Framework, so lowercase--frameworkwas rejected. The four test templates also lacked framework selection entirely, despite their sibling application/library/binding templates already supporting .NET 11 and .NET 10. This PR fixes both gaps.MAUI comparison: Five MAUI project templates already expose
--frameworkand-f; the engine derives-ffrom the lowercaselongNameeven without an explicitshortName. MAUI's version-specific packaging and bare framework values are intentional differences, not something to copy into Apple templates.One additional upstream inconsistency was found in MAUI's Aspire service-defaults template: its host file is named
dotnetcli.jsonrather thandotnetcli.host.json. Runtime verification showed--frameworkand-ffail with exit code 127, while--Frameworkand-Fsucceed. Renaming that file is a separate fix needed in dotnet/maui; it is not included here.Validation
iosandiostestlowercase-option failures before the change (exit code 127).bundleId/minOSVersionpreservation checks.git diff --check.The normal SDK invocation is blocked on this Windows host by the unavailable pinned SDK
12.0.100-alpha.1.26480.102. Validation used installed SDK11.0.100-rc.1.26425.128with isolated template installations, after restoring the missingXamarin.MacDevsubmodule. Native Apple build/run testing was not performed: it requires macOS, Xcode, and Apple workloads.Note
This PR description and implementation were generated with GitHub Copilot.