Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add project name normalization to match aspire's code generator logic#6818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ViveliDuCh merged 7 commits intodotnet:mainfromViveliDuCh:bugfix-6331
Sep 24, 2025

Conversation

@ViveliDuCh
Copy link
Member

@ViveliDuChViveliDuCh commentedSep 17, 2025
edited by dotnet-policy-servicebot
Loading

Fixes#6811

Apply project name transformation in the templates' generated code using the same normalization logic as inAspire.Hosting.AppHost.targets. This ensures that when the--aspire flag is used, the generatedAppHost/Program.cs references normalized class names (e.g.,some_name instead ofsome.name), resolving build errors caused by mismatched type or namespace references.

Add execution tests to verify the fix for templates with dots or other non-identifier characters in their names.

Microsoft Reviewers:Open in CodeFlow

…-aspire projects. Add execution tests for the fix.
@ViveliDuChViveliDuCh requested a review froma team as acode ownerSeptember 17, 2025 23:01
CopilotAI review requested due to automatic review settingsSeptember 17, 2025 23:01
@github-actionsgithub-actionsbot added the area-ai-templatesMicrosoft.Extensions.AI.Templates labelSep 17, 2025
Copy link
Contributor

CopilotAI 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 addresses build errors that occur when using the--aspire flag with project names containing dots or other non-identifier characters. The fix applies Aspire's project name normalization logic to templates to ensure generated code references match the normalized class names.

  • Adds project name normalization transforms to template configuration
  • Introduces a new test case to verify the fix works with project names containing dots
  • Ensures consistency between template-generated code and Aspire's AppHost target behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
AIChatWebExecutionTests.csAdds test case for project names with dots to verify normalization fix
template.jsonImplements project name normalization transforms using regex replacement

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

@ViveliDuChViveliDuCh added the area-aiMicrosoft.Extensions.AI libraries labelSep 17, 2025
@jeffhandleyjeffhandley removed the area-aiMicrosoft.Extensions.AI libraries labelSep 18, 2025
jeffhandleyand others added2 commitsSeptember 22, 2025 17:53
…ests. Make the Aspire project name theory conditional.
Add an [EnvironmentVariableSkipCondition] attribute for conditional tests. Make the Aspire project name theory conditional.  Keep a single [Fact] that gives comprehensive coverage of the pattern for a single provider.
Copy link
Member

@MackinnonBuckMackinnonBuck left a comment

Choose a reason for hiding this comment

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

Just one piece of feedback but looks great!

Copy link
Member

@jeffhandleyjeffhandley left a comment

Choose a reason for hiding this comment

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

Good idea removing_Web from the replacement token so that it doesn't have to be re-appended.

Since this is now a single-step regex replacement, I had look back at thehttps://github.com/dotnet/templating/wiki/Reference-for-template.json#derived-symbol docs to understand why this is aderived replacer vs. the samegenerator approach as is used in the Aspire template. It makes sense though--we need the project name to get plugged in and do post-processing over that derived symbol.

Looks good!

ViveliDuCh reacted with laugh emoji
@ViveliDuChViveliDuCh merged commit7200baa intodotnet:mainSep 24, 2025
6 checks passed
@ViveliDuChViveliDuCh deleted the bugfix-6331 branchSeptember 24, 2025 16:00
This was referencedOct 22, 2025
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 25, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@MackinnonBuckMackinnonBuckMackinnonBuck approved these changes

@jozkeejozkeejozkee approved these changes

Copilot code reviewCopilotCopilot left review comments

@jeffhandleyjeffhandleyjeffhandley approved these changes

Assignees

@ViveliDuChViveliDuCh

Labels

area-ai-templatesMicrosoft.Extensions.AI.Templates

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

MEAI chat web template with --aspire flag: Class name mismatch in AppHost Program.cs causes build error

4 participants

@ViveliDuCh@jeffhandley@MackinnonBuck@jozkee

[8]ページ先頭

©2009-2025 Movatter.jp