Skip to content

Fix and refresh Rules to Better .NET 10 Migrations - #13059

Draft
KostaMadorsky wants to merge 2 commits into
mainfrom
rules-dotnet-migration-updates
Draft

Fix and refresh Rules to Better .NET 10 Migrations#13059
KostaMadorsky wants to merge 2 commits into
mainfrom
rules-dotnet-migration-updates

Conversation

@KostaMadorsky

@KostaMadorsky KostaMadorsky commented Jul 25, 2026

Copy link
Copy Markdown
Member

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

  • use-banned-api-analyzers — corrected invalid TFM net4.8net48 (was the only such occurrence in the whole repo).
  • migration-plans — finished the .NET 8 → .NET 10 rename that PR XS ◾ ♻️ Updating all reference of .NET 8 to .NET 10 #11766 started: the multi-targeting example was still net48;net8.0 even though its own image caption says ".NET 10". Now net48;net10.0.
  • migrate-global-asax-to-asp-net-core — the code sample used the non-existent Application_Stopping() / Application_Stopped() methods, contradicting the prose (which correctly describes Application_End() / Application_Disposed()). Aligned the sample with the prose.

Typos

  • migrating-web-apps-to-dotnet — "stranger fig" → "strangler fig", "interating" → "iterating".

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.0
  • pivots=dotnet-9-0pivots=dotnet-10-0

Affected: 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-projects is archived (merged into migration-plans) but still listed in the index and still references .NET 8. Left as-is per author direction.

- 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>
@github-actions github-actions Bot added the Age: 🥚 - New About 2 hours old label Jul 25, 2026
- 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>
@github-actions github-actions Bot added Age: 🐣 - Young About 4 hours old Age: 🐥 - Adolescent About 8 hours old Age: 🐤 - Mature About 16 hours old Age: 🐓 - Old About 32 hours old Age: 🍗 - Ancient About 64 hours old 🔥 Merge Debt This PR contains merge debt, see https://www.ssw.com.au/rules/merge-debt/ and removed Age: 🥚 - New About 2 hours old Age: 🐣 - Young About 4 hours old Age: 🐥 - Adolescent About 8 hours old Age: 🐤 - Mature About 16 hours old Age: 🐓 - Old About 32 hours old labels Jul 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Howzit @KostaMadorsky,

This PR has been here a while.

Did you know you should avoid merge debt?

  1. Please action (e.g. get a review) and merge or close

Thanks!

@KostaMadorsky
KostaMadorsky marked this pull request as draft July 27, 2026 01:11
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi @KostaMadorsky,

This PR is currently in Draft mode. To help it get reviewed and merged:

  1. ✍️ Update PR title & add a description - Explain what changes you've made and why
  2. Mark as ready for review - Click "Ready for review" when you're done
  3. 👥 Add reviewers - Assign people to review your changes
  4. 📣 Notify reviewers - Message or call them to let them know the PR is ready

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.

@github-actions github-actions Bot added Age: 🦖 - Extinct About 128 hours old and removed Age: 🍗 - Ancient About 64 hours old labels 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Check this, the flag does not seem to ever exist in EF Core

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"));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Don't try to map to older lifehooks as they are different, just call it Stopping and Stopped

**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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Check this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Age: 🦖 - Extinct About 128 hours old 🔥 Merge Debt This PR contains merge debt, see https://www.ssw.com.au/rules/merge-debt/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant