What you need is a library that targets .NET Standard
, not .NET Core
.
.NET Standard
is a specification that various frameworks can implement.
In the case of .NET Standard 2, it is supported by the following frameworks or superior versions:
- .NET Core 2.0
- .NET Framework 4.6.1
- Mono 5.4
- Xamarin.iOS 10.4
- Xamarin.Mac 3.8
- Xamarin.Android 7.5
- Universal Windows Platform vNext (Does not yet support .NET Standard 2.0)
In turn, a library created in .NET Standard can be referenced by those frameworks or higher versions.
However, the best thing to do is to point to the lowest possible version you can aim for, in this way your library will be compatible with more platforms and previous versions of those mentioned.
For more information on the compatibility table, see: .NET Standard - .NET implementation support