-
Not able to find a conclusive answer to following scenario. I am developing a .NET5 library which should be usable with .NET Core 3.1 and .NET5. It works as expected. But my requirement is to make this library available to applications written in .NET Framework 4.8 also. Going by various articles, it looks like that is supported. But my package is not usable from .NET Framework 4.8 application. I am aware of tag and I can include like the following in the .csproj file: My understanding is, its not needed to include net48 once the net5.0 is included. Is this a correct assumption? If it is correct assumption, then is there anything else needed to be done. Any help is appreciated. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The way to think about it is that you're multi-targeting your library so that it can run in multiple places, .NET Framework 4.8, .NET Core 3.1 and .NET 5. It's inaccurate to say that you're writing a .NET 5 library that runs on .NET Core 3.1 as that doesn't always work.
It's not supported. You can either build a .NET Standard 2.0 library that runs everywhere, or you can target each of those platforms you want to support my changing your project file to specify them individually. See https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting for more information. |
Beta Was this translation helpful? Give feedback.
The way to think about it is that you're multi-targeting your library so that it can run in multiple places, .NET Framework 4.8, .NET Core 3.1 and .NET 5. It's inaccurate to say that you're writing a .NET 5 library that runs on .NET Core 3.1 as that doesn't always work.
It's not supported. You can either build a .NET Standard 2.0 library that runs everywhere, or you can target each of those platforms you want to support my changing your project file to specify them individually.
See https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting for more information.