Upgrade to .NET 10 and Orleans 10 with Roslyn 5.x pinning - #20
Merged
Conversation
Retarget every project to net10.0 and pin the SDK to 10.0.400 (LTS) in global.json. Package updates: - Microsoft.Extensions.* 9.0.8 -> 10.0.11 - Microsoft.Orleans.* 9.2.1 -> 10.2.2 - Microsoft.CodeAnalysis.NetAnalyzers 9.0.0 -> 10.0.400 - Microsoft.EntityFrameworkCore.* 9.0.8 -> 9.0.19 (latest 9.x patch) - dotnet-ef tool 9.0.8 -> 9.0.19 to match the EF Core runtime EF Core stays on 9.x because Pomelo.EntityFrameworkCore.MySql 9.0.0 pins Microsoft.EntityFrameworkCore.Relational to [9.0.0, 9.0.999] and Pomelo has no EF Core 10 release yet. The hold is documented in Directory.Packages.props and AGENTS.md. Orleans 10 requires Microsoft.CodeAnalysis 5.x while EF Core 9's design-time packages still ask for 4.8.0, which fails restore under central transitive pinning (NU1107). The Roslyn family is now pinned explicitly at 5.0.0. Also dropped the explicit System.Collections 4.3.0 reference, which .NET 10 prunes automatically (NU1510), and refreshed the SDK version checks in the bootstrap scripts, the net9.0 output paths in .vscode configs, and the stack versions in AGENTS.md/README.md. Verified with a clean `dotnet build Turbo.Main/Turbo.Main.csproj -t:TurboCloudQualityGate -p:TurboAIPolicyPhase=1` on SDK 10.0.400: 0 errors, gate green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H1WWL4hLiAvJr2jzxoGyaP
ConfigureAwait(false) is an explicit opt-out of the current task scheduler. In grain code that means the continuation resumes on TaskScheduler.Default instead of the activation's scheduler, which drops the grain context and voids the turn-based single-threaded execution guarantee for everything after the await. Orleans has documented this as "never do this in grain code" for years; Orleans 10 added ORLEANS0014 to detect it. The two load-bearing cases were PlayerWalletGrain.TryDebitAsync, where the escape happened on the first await and took the whole debit transaction (state mutation, SaveChanges, Commit, and the outgoing presence call) off the scheduler, and the two InventoryGrain grant paths, which did the same around SaveChangesAsync and AddFurnitureAsync. The remaining sites were trailing awaits with no code after them. Removed rather than rewritten to ConfigureAwait(true): that is the default, and .editorconfig already disables CA2007 for grain code, so these files stay warning-free. Only grain classes are touched. ConfigureAwait(false) in services, handlers and providers is correct and left as-is. Clean quality gate on SDK 10.0.400: 0 errors, ORLEANS0014 cleared, no new CA2007. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H1WWL4hLiAvJr2jzxoGyaP
GrantCatalogOfferAsync and GrantLtdFurnitureAsync disposed their DbContext through an explicit try/finally, which is exactly what `await using var` compiles to. Switched both to the declaration form, matching how PlayerWalletGrain already creates its context. No behavioral change: disposal still happens on every exit path, including exceptions. Pure de-indent of the former try bodies. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H1WWL4hLiAvJr2jzxoGyaP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade the project from .NET 9 to .NET 10, Orleans 9.2.1 to 10.2.2, and Microsoft.Extensions packages to 10.0.11. Pin Roslyn (Microsoft.CodeAnalysis) to 5.0.0 to resolve transitive version conflicts between Orleans 10 (which requires 5.x) and EF Core 9 design-time packages (which still reference 4.8.0). EF Core remains on 9.x pending Pomelo MySQL provider support for EF Core 10.
Key Changes
.csprojfiles fromnet9.0tonet10.0global.jsonfrom 9.0.310 to 10.0.400System.Collections4.3.0 package reference from Turbo.Main.ConfigureAwait(false)calls throughout codebase (now unnecessary in .NET 10 with improved async context handling)Implementation Details
ConfigureAwait(false)calls, leveraging .NET 10's improved default context behaviorhttps://claude.ai/code/session_01H1WWL4hLiAvJr2jzxoGyaP