Skip to content

Conversation

@mattleibow
Copy link
Member

@mattleibow mattleibow commented Oct 2, 2025

This pull request updates the .template.config/dotnetcli.host.json files for several MAUI template projects to improve symbol configuration and control visibility of template options. The main changes involve marking certain template symbols as hidden, updating symbol descriptions, and standardizing symbol definitions across templates.

Note

This is part of #23168. We have to update the .NET 9 templates because the CLI is a merge of all the installed template options. If .NET 9 uses bad options, then it flows through to .NET 10.
This does not affect the available options and all previous ones work, it just affects the "pretty" options.

Symbol visibility and configuration improvements:

  • Added the msExtensionsLoggingDebugVersion symbol and marked it as hidden in all affected templates to prevent it from appearing in user-facing options. [1] [2] [3] [4]
  • Marked the IncludeSampleContent symbol as hidden in maui-blazor-solution, maui-blazor, and maui-mobile templates to restrict its visibility. [1] [2] [3]
  • Added or updated several symbol definitions in maui-blazor-solution, including hiding symbols related to web components, ports, user secrets, and sample content, and providing long names for others to improve clarity.
  • Standardized the Framework symbol definition by adding a longName property across all templates for consistency. [1] [2] [3] [4]
  • Updated the Empty symbol in maui-blazor-solution and maui-blazor templates to include a longName property, clarifying its usage. [1] [2]

Note

The formatting was bad, so review with ignoring whitespaces: https://github.com/dotnet/maui/pull/31848/files?w=1

Copilot AI review requested due to automatic review settings October 2, 2025 17:48
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 pull request standardizes and improves the CLI template configuration for .NET MAUI project templates by cleaning up symbol definitions and controlling their visibility in the dotnet CLI. The changes ensure that internal version symbols are hidden from users while providing consistent naming conventions for user-facing options.

  • Hidden internal version and configuration symbols to prevent them from appearing in CLI help
  • Standardized symbol naming by adding longName properties for consistency across templates
  • Improved user experience by hiding implementation details while preserving all functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
maui-multiproject/.template.config/dotnetcli.host.json Added hidden msExtensionsLoggingDebugVersion symbol and Framework longName
maui-mobile/.template.config/dotnetcli.host.json Added hidden msExtensionsLoggingDebugVersion symbol and Framework longName
maui-blazor/.template.config/dotnetcli.host.json Added hidden symbols and longName properties for Framework, IncludeSampleContent, and Empty
maui-blazor-solution/.template.config/dotnetcli.host.json Comprehensive symbol configuration with hidden version/port symbols and standardized longName properties

@mattleibow
Copy link
Member Author

mattleibow commented Oct 2, 2025

The reason for .NET 9 templates to fix .NET 10 is this:

Everything below --localhost-tld is .NET 9 only, yet will appear because they are not hidden and you may use the net9.0 TFM

.NET MAUI Blazor Hybrid and Web App (C#)
Author: Microsoft
Description: A multi-project app for creating a .NET MAUI Blazor Hybrid application with a Blazor Web project with a shared user interface.

Usage:
  dotnet new maui-blazor-web [options] [template options]

Options:
  -n, --name <name>       The name for the output being created. If no name is specified, the name of the output directory is used.
  -o, --output <output>   Location to place the generated output.
  --dry-run               Displays a summary of what would happen if the given command line were run if it would result in a template creation. [default: False]
  --force                 Forces content to be generated even if it would change existing files. [default: False]
  --no-update-check       Disables checking for the template package updates when instantiating a template. [default: False]
  --project <project>     The project that should be used for context evaluation.
  -lang, --language <C#>  Specifies the template language to instantiate.
  --type <solution>       Specifies the template type to instantiate.

Template options:
  -ap, --applicationId <applicationId>                                             Overrides the $(ApplicationId) in the project
                                                                                   Type: string
  -f, --framework <net10.0|net9.0>                                                 The target framework for the project.
                                                                                   Type: choice
                                                                                     net10.0  Target net10.0
                                                                                     net9.0   Target net9.0
                                                                                   Default: net10.0
  --exclude-launch-settings                                                        Whether to exclude launchSettings.json from the generated template.
                                                                                   Type: bool
                                                                                   Default: false
  -int, --interactivity <Auto|None|Server|WebAssembly>                             Chooses which interactive render mode to use for interactive components
                                                                                   Type: choice
                                                                                     None         No interactivity (static server rendering only)
                                                                                     Server       Runs on the server
                                                                                     WebAssembly  Runs in the browser using WebAssembly
                                                                                     Auto         Uses Server while downloading WebAssembly assets, then uses WebAssembly
                                                                                   Default: Server
  -e, --empty                                                                      Configures whether to omit sample pages and styling that demonstrate basic usage patterns.
                                                                                   Type: bool
                                                                                   Default: false
  -ai, --all-interactive                                                           Configures whether to make every page interactive by applying an interactive render mode at the top level. If false, pages 
                                                                                   will use static server rendering by default, and can be marked interactive on a per-page or per-component basis.
                                                                                   Enabled if: (InteractivityPlatform != "None")
                                                                                   Type: bool
                                                                                   Default: false
  --no-https                                                                       Whether to turn off HTTPS. This option only applies if Individual isn't used for --auth.
                                                                                   Type: bool
                                                                                   Default: false
  --use-program-main                                                               Whether to generate an explicit Program class and Main method instead of top-level statements.
                                                                                   Type: bool
                                                                                   Default: false
  --localhost-tld                                                                  Whether to combine the project name with the .dev.localhost TLD in the application URL for local development, e.g. 
                                                                                   https://myapp.dev.localhost:12345.
                                                                                   Type: bool
                                                                                   Default: false
  -m, --msExtensionsLoggingDebugVersion <msExtensionsLoggingDebugVersion>          Type: string
                                                                                   Default: 9.0.5
  -c, --componentsWebVersion <componentsWebVersion>                                Type: string
                                                                                   Default: 9.0.5
  -co, --componentsWebAssemblyVersion <componentsWebAssemblyVersion>               Type: string
                                                                                   Default: 9.0.5
  -p:c, --componentsWebAssemblyServerVersion <componentsWebAssemblyServerVersion>  Type: string
                                                                                   Default: 9.0.5
  -F, --FrameworkAspNet <FrameworkAspNet>                                          Type: string
                                                                                   Default: net9.0
  -U, --UserSecretsId <UserSecretsId>                                              The ID to use for secrets (use with Individual auth).
                                                                                   Type: string
                                                                                   Default: aspnet-MauiApp.1-53bc9b9d-9d6a-45d4-8429-2a2761773502
  -E, --ExcludeLaunchSettings                                                      Whether to exclude launchSettings.json from the generated template.
                                                                                   Type: bool
                                                                                   Default: false
  -k, --kestrelHttpPort <kestrelHttpPort>                                          Port number to use for the HTTP endpoint in launchSettings.json.
                                                                                   Type: integer
                                                                                   Default: 0
  -ke, --kestrelHttpsPort <kestrelHttpsPort>                                       Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter 
                                                                                   no-https is not used (no-https will be ignored if Individual auth is used).
                                                                                   Type: integer
                                                                                   Default: 0
  -ii, --iisHttpPort <iisHttpPort>                                                 Port number to use for the IIS Express HTTP endpoint in launchSettings.json.
                                                                                   Type: integer
                                                                                   Default: 0
  -p:i, --iisHttpsPort <iisHttpsPort>                                              Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the 
                                                                                   parameter no-https is not used (no-https will be ignored if Individual auth is used).
                                                                                   Type: integer
                                                                                   Default: 0
  -I, --InteractivityPlatform <Auto|None|Server|WebAssembly>                       Chooses which interactive render mode to use for interactive components
                                                                                   Type: choice
                                                                                     None         No interactivity (static server rendering only)
                                                                                     Server       Runs on the server
                                                                                     WebAssembly  Runs in the browser using WebAssembly
                                                                                     Auto         Uses Server while downloading WebAssembly assets, then uses WebAssembly
                                                                                   Default: Server
  -In, --IncludeSampleContent                                                      Configures whether to add sample pages and styling to demonstrate basic usage patterns.
                                                                                   Type: bool
                                                                                   Default: true
  -Em, --Empty                                                                     Configures whether to omit sample pages and styling that demonstrate basic usage patterns.
                                                                                   Type: bool
                                                                                   Default: false
  -A, --AllInteractive                                                             Configures whether to make every page interactive by applying an interactive render mode at the top level. If false, pages 
                                                                                   will use static server rendering by default, and can be marked interactive on a per-page or per-component basis.
                                                                                   Enabled if: (InteractivityPlatform != "None")
                                                                                   Type: bool
                                                                                   Default: false
  -N, --NoHttps                                                                    Whether to turn off HTTPS. This option only applies if Individual isn't used for --auth.
                                                                                   Type: bool
                                                                                   Default: false
  -Us, --UseProgramMain                                                            Whether to generate an explicit Program class and Main method instead of top-level statements.
                                                                                   Type: bool
                                                                                   Default: false

@mattleibow mattleibow added this to the .NET 9 SR12 milestone Oct 2, 2025
@mattleibow mattleibow added the p/0 Current heighest priority issues that we are targeting for a release. label Oct 2, 2025
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Oct 8, 2025
@PureWeen
Copy link
Member

PureWeen commented Oct 8, 2025

/backport to release/9.0.1xx-sr12

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Started backporting to release/9.0.1xx-sr12: https://github.com/dotnet/maui/actions/runs/18353556829

@mattleibow
Copy link
Member Author

These chnages will be breaking and there is no need to break. for this. The ides and editors already hide it. This is semantics for the CLI.

@mattleibow mattleibow closed this Oct 13, 2025
@github-project-automation github-project-automation bot moved this from Ready To Review to Done in MAUI SDK Ongoing Oct 13, 2025
@mattleibow mattleibow deleted the dev/fix-net9-templates-cli branch October 13, 2025 17:25
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p/0 Current heighest priority issues that we are targeting for a release.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants