I have a netstandard2.0 project that I'm using to interface with a 3rd party web service. I need to reference that project from an older .net 4.6.2 project in the same solution, but when I do I get a bunch of errors about needing references to types that I have defined.
For example, I'll call a method in the netstandard library that returns Task, but I'll get an error saying I need a reference to System.Threading.Tasks even though I already have one.
I believe there are two issues here.
Only certain version of .netstandard work with certain versions of .net 4.X.Y
To resolve this you may need to change the version of one or both projects. Use the chart to figure out which versions are compatible together: https://learn.microsoft.com/en-us/dotnet/standard/net-standard
.net 4.X.Y uses the 4.0.0.0 system libraries, whereas .netstandardX.Y uses 4.3.0.0
To resolve this you need to add and reference the netstandard.library NuGet package.