This is a simple demo showing the results of getting code from full .NET to .NET Standard.
- The only project was
FullNetLibrary, with all.csfiles - Add a new Shared Class Library project named
SharedLibrary - Copy all
.csfiles fromFullNetLibrarytoSharedLibrary - Delete all
.csfiles fromFullNetLibrary - Add reference in
FullNetLibrarytoSharedLibraryusing the Shared Projects tab in the Add Reference dialog - YOU ARE NOW WHERE YOU STARTED - so you can build the
FullNetLibraryproject and have the exact same output dll as in step 1 - Add a new .NET Standard Class Library project named
NetStandardLibrary - Add reference in
NetStandardLibrarytoSharedLibraryusing the Shared Projects tab in the Add Reference dialog - In
NetStandardLibraryadd NuGet package reference toNewtonsoft.Json - In
NetStandardLibraryadd NuGet package reference toMicrosoft.EntityFrameworkCore - Use the
NETSTANDARD2_0compiler constant to add compiler directives to thePersonFactory.csfile so it contains the original EF code for the full .NET project, and new EF Core code for the netstandard project
The result is that the FullNetLibrary still builds the exact same code in the exact same way as before we started this exercise. And we now have a NetStandardLibrary that builds most of the same code - the only differences being where we had to accomodate differences between full .NET and netstandard.