An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Thanks for reaching out.
Class libraries have different support because .NET Framework and modern .NET (.NET 5+) are different runtimes with different goals.
- .NET Framework is Windows‑only and in maintenance mode. It receives security fixes but no new features. It exists mainly for legacy applications.
- Modern .NET (.NET 5+) is the future platform. It is cross‑platform, actively developed, and gets new APIs, performance improvements, and long‑term support (LTS/STS).
Because the available APIs differ, a single binary cannot always work for both runtimes.
Recommended options:
- Multi‑targeting (recommended) Build one library that targets multiple frameworks (for example
net48; net8.0). NuGet automatically selects the correct version for the consumer. - .NET Standard (limited today) Useful only if you need broad compatibility with older platforms, but it is frozen and not recommended for new development.
- Separate libraries/packages Use this when you depend on runtime‑specific or Windows‑only APIs.
Roadmap:
- .NET Framework will continue to be supported with Windows but will not get new features.
- Modern .NET is Microsoft’s strategic direction and should be used for all new libraries and applications.
Important: Not every NuGet package must support both .NET Framework and modern .NET. Multi‑targeting is the correct and supported approach when you need to support both.
Let us know if the issue persists after following these steps. I’ll be happy to assist further if needed. If the issue has been resolved, Kindly mark the provided solution as "Accept Answer", so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.