[CI Failure] Flaky: CanNewAndBuild(aspire-mstest, Net8) fails with Roslyn Method not found TryGetMaxCharCount on macOS
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
## Build Information
Build: https://github.com/microsoft/aspire/actions/runs/30654518872
Build error leg or test failing: Tests / Templates-MSTest_NewUpAndBuildSupportProjectTemplatesTests / Templates-MSTest_NewUpAndBuildSupportProjectTemplatesTests (macos-latest) / `Aspire.Templates.Tests.MSTest_NewUpAndBuildSupportProjectTemplatesTests.CanNewAndBuild(templateName: "aspire-mstest", extraTestCreationArgs: "", sdk: Net8, tfm: Net8, error: null)`
Pull request: #18947
## Error Message
```
CSC : error CS1504: Source file '...GlobalUsings.g.cs' could not be opened -- Method not found: 'Boolean Microsoft.CodeAnalysis.EncodingExtensions.TryGetMaxCharCount(System.Text.Encoding, Int64, Int32 ByRef)'. Build FAILED.
at Aspire.Templates.Tests.CommandResult.EnsureExitCode
at Aspire.Templates.Tests.AspireProject.BuildAsync
at Aspire.Templates.Tests.NewUpAndBuildSupportProjectTemplatesBase.CanNewAndBuildActual
```
## Description
Flaky: CanNewAndBuild(aspire-mstest, Net8) fails with Roslyn Method not found TryGetMaxCharCount on macOS
**Type**: flaky-test
## Occurrences
| Date | Build | Job | PR |
|------|-------|-----|----|
| 2026-07-31 | [30654518872](https://github.com/microsoft/aspire/actions/runs/30654518872) | Tests / Templates-MSTest_NewUpAndBuildSupportProjectTemplatesTests / Templates-MSTest_NewUpAndBuildSupportProjectTemplatesTests (macos-latest) | #18947 |
Contributor guide
Research direction
Start with Aspire.Templates.Tests.MSTest_NewUpAndBuildSupportProjectTemplatesTests.CanNewAndBuild for the aspire-mstest Net8 case and review the failure through CommandResult.EnsureExitCode and AspireProject.BuildAsync. Re-run the macos-latest test and compare its Roslyn dependency context with the reported TryGetMaxCharCount error. Done means the test reliably builds on macOS without this method-not-found failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github-actions, macos
- Domain
- ci-cd, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100