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

后端 未结 3 1969
南方客
南方客 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

    .NET 5 will have the same compatilbity layer that .NET Core currently has.

    This allows you to reference .NET Framework DLLs with the caveat that the DLL may not load or execute at runtime. If it is a logic library, it may work well. Not su much if it relieves on e.g. System.Web. This is especially useful for 3rd party libraries which you don't have the source code for. You can use the The .NET Portability Analyzer to check for any use of unsupported APIs in such libraries.

    That being said, you should try to change your existing .NET Framework libraries to .NET Standard or multi-target to bot .NET Framework and .NET Standard.

提交回复
热议问题