📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

How would you ship a library to NuGet that supports both .NET Framework 4.8 and .NET 10, and how do you decide when to drop the net48 target?

Mid-Level Coding Intermediate

🎯 Key points

  • TargetFrameworks with net48 plus supported modern LTS targets (net8.0, net10.0)
  • Conditional compilation and conditional package references kept to a minimum
  • Tests run on every target in CI
  • Track consumers' frameworks (NuGet stats, internal inventory) and revisit each major release
  • Announce first; removing a TFM is a major version bump

⏱ 30-second answer

Multi-target in the .csproj (<TargetFrameworks>net48;net8.0;net10.0</TargetFrameworks>, or netstandard2.0;net10.0 if you need no Framework-only APIs), use #if NETFRAMEWORK sparingly, and let dotnet pack produce one lib/<tfm> folder per target. Run the test suite on every target in CI. Only target supported runtimes: .NET 6 and 7 are out of support, so the modern targets are the LTS releases (.NET 8 and .NET 10).

Decide when to drop net48 from data, and review it regularly (for example each major release): NuGet download stats per framework, internal consumers' target frameworks, and support requests. Announce the removal a release ahead, and remove it in a major version because dropping a target is a breaking change.

🔍 What the interviewer is checking

Checks they can manage the lifecycle of a multi-targeted package

↩ Usually asked after

More in Migration Topics

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me