Code Sharing in .NET Core
With .NET Core, we can currently develop applications with three different .NET frameworks for different platforms. The traditional or standard .NET Framework is for Windows, Mono framework for iOS, OSx, and Android, and .NET Core for Windows, Mac, and Linux.
These frameworks use different framework class libraries. It means code written in one framework cannot be used with other frameworks. For example, a console application developed with .NET Framework cannot run on .NET Core or vice-versa. Thus, code-sharing is not allowed.
It would be nice to write code once and share it with other applications with different .NET frameworks. Isn't it?
To solve this problem of code sharing, we can use the following three approaches: