Can I add a reference to a .NET Framework DLL from a .NET 5 project?

后端 未结 3 1953
南方客
南方客 2021-01-18 05:08

Microsoft recently announced at Build 2019 that the next major version of .NET will unify both .NET Core 3.* and .NET Framework 4.* into a single .NET platform, which the ma

3条回答
  •  时光取名叫无心
    2021-01-18 06:01

    It will be the same as today: you will be able to reference .NET Standard libraries. .NET 5 does not contain everything of the classic framework, therefore it won't be possible to reference a .NET 4.x assembly directly. Therefore start to write libraries in .NET Standard.

    However in .NET Core 2.0 Microsoft implemented the compatibility shim that allows type forwarding of missing tpyes in old assemblies to the new type. As long as your library does not use any classes that are not supported by .NET 5, you're safe.

    See this post or this for more information.

提交回复
热议问题