I'm tasked with starting a "slow migration" from .NET Framework (4.7.1) to .NET Core (2.1) at work. We have a very large application, and aren't able to just stop development and create a brand new stack simply in .NET Core. I've worked through having a .NET Standard (2.0) library as the "go between" for the .NET Framework and the .NET Core projects. However, I'm running into an issue with some Core-specific code.
My .NET Core .csproj file looks like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netstandard2.0</TargetFrameworks>
</PropertyGroup>
</Project>
I had to add the netstandard2.0 and make it multi-framework to include the interfaces in our Standard library.
When I do that, I get all sorts of build errors when trying to use code that is only in Core. For example, I get the following error:
'File' does not contain a definition for 'AppendAllTextAsync'.
Is there any way to utilize or even have the new functionality in our application before we remove the .NET Framework and Standard code? (I have tried a brand new .NET Core Project in a new Solution, and it worked fine until I changed the .csproj to TargetFrameworks.
#if, etc. In order to UTILIZE you'd need to go farther and provide adequate substitution of desirable behavior for each platform you're going to support.