Migration and compatibility audit
Migration and compatibility audit
A migration audit distinguishes changes that break source compilation, existing binaries, or observable behavior.
Inventory target frameworks, OS-specific APIs, native dependencies, NuGet assets, configuration, authentication and data contracts before moving a legacy application. .NET Framework is Windows-oriented and is not the same runtime as modern .NET. System.Web applications cannot simply retarget to ASP.NET Core; pipeline, hosting, authentication and session behavior require review. Incremental migration can route selected functionality to a new ASP.NET Core app, with carefully reviewed System.Web adapters where appropriate. .NET Standard is an API specification rather than a runtime. netstandard2.0 is a possible shared library lane when older supported .NET Framework consumers require it, but framework compatibility does not certify every dependency or API. .NET Standard 2.1 is not supported by .NET Framework. EF6 and EF Core differ in mappings, migrations and query translation; EF6 can be retained temporarily in compatible cases. For WCF server workloads investigate CoreWCF compatibility, existing supported WCF hosting or a redesigned HTTP/gRPC contract; verify bindings, security, serialization, transactions and client compatibility. Do not assert automated conversion. Use the checked .NET 10 compatibility documentation, build a dependency inventory, then test source, binary and behavior separately. Separate schema changes from application rollout and plan a reversible boundary. The included multi-target lab exercises a deliberately small common library, not the actual Framework runtime.
Baseline: .NET 10 / C# 14. All C# results below are reasoned, not executed. Synthetic calculations are not vendor quotes or production measurements.
Separate compatibility evidence
The sample audits a release using three independent checks.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;foreach (var r in new[]{(Source:true,Binary:false,Behavior:true),(Source:true,Binary:true,Behavior:false),(Source:true,Binary:true,Behavior:true)}) Console.WriteLine(r.Source && r.Binary && r.Behavior ? "eligible for review" : "blocked");Expected result (not executed):
blockedblockedeligible for reviewRecompiling a consumer tests source compatibility, not the previously compiled consumer. Behavioral tests need representative contracts.
Preserve an older wire contract
An adapter maps a new internal enum to stable legacy strings.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;static string LegacyStatus(State s) => s switch { State.Ready=>"ready", State.Pending=>"pending", _=>throw new ArgumentOutOfRangeException(nameof(s)) };Console.WriteLine(LegacyStatus(State.Ready));Console.WriteLine(LegacyStatus(State.Pending));try { Console.WriteLine(LegacyStatus((State)99)); } catch(ArgumentOutOfRangeException) { Console.WriteLine("rejected"); }enum State { Pending, Ready }Expected result (not executed):
readypendingrejectedDo not serialize numeric enum values accidentally when the old wire contract expects fixed text. Unknown values fail explicitly in this sample.
Characterize a culture-sensitive behavior
Use explicit culture to preserve the established numeric parsing contract.
Inspect the archived Fixture.csproj and use only an approved .NET 10 SDK. Build and run in an isolated lab with finite time and resource limits.
using System;using System.Globalization;static bool ParseAmount(string input,out decimal amount) => decimal.TryParse(input,NumberStyles.AllowDecimalPoint,CultureInfo.InvariantCulture,out amount);foreach (string s in new[]{"12.50","12,50","bad"}) Console.WriteLine(ParseAmount(s,out decimal n)?n.ToString("0.00",CultureInfo.InvariantCulture):"invalid");Expected result (not executed):
12.50invalidinvalidA migration must preserve input semantics or deliberately version the change. Verify real user locales separately.
Apply the concept
Audit a fictional .NET Framework web app with System.Web, EF6 and a WCF service. Propose a phased migration.
Use the manual practice and knowledge check. Do not deploy or publish these fixtures.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Migration and compatibility audit — knowledge check
Apply the lesson concepts to the following scenarios.
A previously compiled consumer cannot load a changed method. What risk is this?
Is .NET Standard a runtime?
Which standard target is a candidate for supported .NET Framework clients?
Can System.Web simply be retargeted to ASP.NET Core?
What should a WCF replacement review include?