Fix and refresh Rules to Better .NET 10 Migrations - #13059
Draft
KostaMadorsky wants to merge 2 commits into
Draft
Conversation
- use-banned-api-analyzers: correct invalid TFM `net4.8` -> `net48` (was the only such occurrence in the repo) - migration-plans: finish the .NET 8 -> .NET 10 rename in the multi-targeting example (`net48;net8.0` -> `net48;net10.0`), matching the ".NET 10" image caption directly below it - migrating-web-apps-to-dotnet: fix typos "stranger fig" -> "strangler fig" and "interating" -> "iterating" - migrate-global-asax-to-asp-net-core: align the code sample with the prose by using the real Global.asax events `Application_End()` / `Application_Disposed()` instead of the non-existent `Application_Stopping()` / `Application_Stopped()` - Refresh outdated Microsoft Learn doc links to current versions (aspnetcore-7.0/9.0 -> aspnetcore-10.0, retired dotnet-plat-ext-7.0 -> net-10.0, pivots dotnet-9-0 -> dotnet-10-0) across the Web.config, Global.asax, System.Web and serialisation rules; all 17 changed URLs verified returning HTTP 200 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
- migrate-from-edmx-to-ef-core: the baseline-migration example used `dotnet ef migrations add --ignore-changes`, but that flag was removed from EF Core (current `migrations add` supports only --output-dir / --namespace), so the command fails. Replaced with the correct approach (add the initial migration, then mark it applied via __EFMigrationsHistory). Added Kosta Madorsky as an author. - do-you-check-your-api-serialisation-format: "No Support for JSON Patch Documents" is no longer true on .NET 10 - ASP.NET Core now supports JSON Patch with System.Text.Json via Microsoft.AspNetCore.JsonPatch.SystemTextJson. Reworded to note .NET 10 support (earlier frameworks still need Newtonsoft.Json). - migrate-from-system-web-to-modern-alternatives: prose referred to the interface as "IApplicationContext" but the code defines "IRequestContext"; aligned the name. All new URLs verified returning HTTP 200. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Howzit @KostaMadorsky, This PR has been here a while. Did you know you should avoid merge debt?
Thanks! |
KostaMadorsky
marked this pull request as draft
July 27, 2026 01:11
Contributor
|
👋 Hi @KostaMadorsky, This PR is currently in Draft mode. To help it get reviewed and merged:
Once you've completed these steps, your PR will be ready for approval! This is an automated reminder to help reduce draft PRs without descriptions or reviewers. |
KostaMadorsky
commented
Jul 27, 2026
Comment on lines
+384
to
+386
| # Starting from an existing database? Add the initial migration to capture the | ||
| # current schema, then mark it as applied (insert its row into __EFMigrationsHistory) | ||
| # instead of running it - the old `--ignore-changes` flag has been removed. |
Member
Author
There was a problem hiding this comment.
Check this, the flag does not seem to ever exist in EF Core
KostaMadorsky
commented
Jul 27, 2026
| app.Lifetime.ApplicationStarted.Register(() => Console.WriteLine("Init")); | ||
| app.Lifetime.ApplicationStopping.Register(() => Console.WriteLine("Stopping")); | ||
| app.Lifetime.ApplicationStopped.Register(() => Console.WriteLine("Stopped")); | ||
| app.Lifetime.ApplicationStopping.Register(() => Console.WriteLine("End")); |
Member
Author
There was a problem hiding this comment.
Don't try to map to older lifehooks as they are different, just call it Stopping and Stopped
KostaMadorsky
commented
Jul 27, 2026
| **Figure: Conditional inclusion of the "System.Web" reference in a .NET Framework 4.7.2 project.** | ||
|
|
||
| Next step is to define an interface. For this case, we’ll only expose currently authenticated user. We are calling it IApplicationContext as it contains context for current request, whether it’s coming from an HttpContext or somewhere else if it’s a background job or console application. | ||
| Next step is to define an interface. For this case, we’ll only expose currently authenticated user. We are calling it IRequestContext as it contains context for current request, whether it’s coming from an HttpContext or somewhere else if it’s a background job or console application. |
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.
Overview
Review of the Rules to Better .NET 10 Migrations category (16 rules). Most rules are current; this PR fixes a set of concrete errors and refreshes stale documentation links.
Changes
Factual fixes
net4.8→net48(was the only such occurrence in the whole repo)..NET 8 → .NET 10rename that PR XS ◾ ♻️ Updating all reference of .NET 8 to .NET 10 #11766 started: the multi-targeting example was stillnet48;net8.0even though its own image caption says ".NET 10". Nownet48;net10.0.Application_Stopping()/Application_Stopped()methods, contradicting the prose (which correctly describesApplication_End()/Application_Disposed()). Aligned the sample with the prose.Typos
Documentation link refresh
Bumped outdated Microsoft Learn version monikers to current, matching the newer rules in the category:
?view=aspnetcore-7.0/?view=aspnetcore-9.0→?view=aspnetcore-10.0?view=dotnet-plat-ext-7.0(retired moniker) →?view=net-10.0pivots=dotnet-9-0→pivots=dotnet-10-0Affected: Web.config, Global.asax, System.Web and API-serialisation rules.
All 17 changed URLs were verified returning HTTP 200 (following redirects).
Not touched (deliberate)
dotnet-upgrade-for-complex-projectsis archived (merged intomigration-plans) but still listed in the index and still references .NET 8. Left as-is per author direction.