Skip to content

Conversation

@jfversluis
Copy link
Member

@jfversluis jfversluis commented Sep 15, 2025

This pull request addresses a template naming issue in the .NET MAUI Aspire Service Defaults project template and adds a test to ensure correct project file naming. When adding this template to your project it would not adopt the project naming, but instead would use the same generic name for each project. This PR fixes that.

Template configuration fixes:

  • Updated defaultName and sourceName in template.json to use consistent and correct naming conventions for the project template.
  • Corrected the primaryOutputs path in template.json to match the expected project file name.

Testing improvements:

  • Added a new integration test AspireServiceDefaultsTemplateUsesCorrectProjectName in SimpleTemplateTest.cs to ensure that the template generates the correct project file name for various input names, and that no incorrectly named files are created.

Fixes #30365

@jfversluis jfversluis added this to the .NET 10.0-rc2 milestone Sep 15, 2025
@jfversluis jfversluis requested a review from a team as a code owner September 15, 2025 12:27
Copilot AI review requested due to automatic review settings September 15, 2025 12:27
@jfversluis jfversluis added the area-templates Project templates, Item Templates for Blazor and MAUI label Sep 15, 2025
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 fixes a template naming issue in the .NET MAUI Aspire Service Defaults project template where generated projects would use generic names instead of adopting the specified project name. The fix ensures proper project file naming conventions and includes comprehensive testing.

  • Updated template configuration to use consistent naming patterns with proper source name placeholders
  • Corrected the primary output path to match the expected project file naming structure
  • Added integration tests to validate correct project naming across different naming scenarios

Reviewed Changes

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

File Description
src/Templates/src/templates/maui-aspire-servicedefaults/.template.config/template.json Updated defaultName, sourceName, and primaryOutputs path to fix template naming issue
src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs Added comprehensive test to verify correct project file naming and validate template behavior

@jfversluis jfversluis merged commit 9af549c into net10.0 Sep 16, 2025
42 of 74 checks passed
@jfversluis jfversluis deleted the fix-30365 branch September 16, 2025 09:43
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 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

None yet

Development

Successfully merging this pull request may close these issues.

3 participants