-
Couldn't load subscription status.
- Fork 712
Fix creating projects with GB18030 chars #11015
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 an issue where creating Aspire projects with GB18030 characters (Chinese characters) in the project name would fail due to encoding problems in MSBuild. The fix involves adding a UTF-8 byte order mark (BOM) to solution template files and re-enabling tests for this scenario.
Key changes:
- Re-enabled previously disabled test for project names with GB18030 characters
- Added UTF-8 BOM to all Aspire solution template files (.sln)
- Updated .NET SDK version from 9.0.200 to 9.0.304 to expose and validate the bug fix
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/Aspire.Templates.Tests/TemplateTestsBase.cs |
Re-enabled test case for GB18030 character project names and updated test name |
src/Aspire.ProjectTemplates/templates/aspire-starter/9.4/Aspire-StarterApplication.1.sln |
Added UTF-8 BOM to solution template file |
src/Aspire.ProjectTemplates/templates/aspire-starter/9.3/Aspire-StarterApplication.1.sln |
Added UTF-8 BOM to solution template file |
src/Aspire.ProjectTemplates/templates/aspire-empty/9.4/AspireApplication.1.sln |
Added UTF-8 BOM to solution template file |
src/Aspire.ProjectTemplates/templates/aspire-empty/9.3/AspireApplication.1.sln |
Added UTF-8 BOM to solution template file |
eng/Versions.props |
Updated .NET SDK version from 9.0.200 to 9.0.304 and fixed comment |
|
if we do a 9.4.3 this possibly should be included |
|
/backport to release/9.4 |
|
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/17109951692 |
|
@danmoseley backporting to "release/9.4" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: fixbom
Using index info to reconstruct a base tree...
M eng/Versions.props
M tests/Aspire.Templates.Tests/TemplateTestsBase.cs
Falling back to patching base and 3-way merge...
Auto-merging eng/Versions.props
CONFLICT (content): Merge conflict in eng/Versions.props
Auto-merging tests/Aspire.Templates.Tests/TemplateTestsBase.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 fixbom
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
Description
Fix #10528
Our template .sln files do not have a BOM. Until recently, MSBuild would read these with "Encoding.Default" ie., UTF-8 on .NET Core. They changed back to old code to reading with "Encoding.GetEncoding(0)" which on Windows gives "Western European (Windows)" - not the same. (Docs being fixed in dotnet/dotnet-api-docs#11712)
Reading a file containing GB18030 characters in UTF-8 encoding using "Western European" corrupts them. The solution parser does not validate they exist; the first place that discovers they don't are the Nuget targets.
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate