I'm currently struggling with something that seems like it's simple, but I can't track down anyone with a similar issue.
I'm converting some libraries to netStandard and one depends on another. We'll call them A and B.
A is compiling fine as a netStandard2.0 library, built with the 3.1 SDK according to dotnet --version in the directory. The nupkg is built in the Release folder and I move it to a local package source to test on my box.
B is a netStandard2.0 class library as well. It requires A, but navigating to my nupkg for A inside of NuGet Package Manager for B and clicking install generates a curious error.
NU1202 A is not compatible with netStandard2.0, Package A supports: netcoreapp2.1
A is a netStandard library.B is a netStandard library.
When I look at the A.csproj file in the tag I'm seeing:
<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>netstandard2.0</TargetFramework><GeneratePackageOnBuild>true</GeneratePackageOnBuild><Description>The initial .net standard 2.0 offering of A</Description></PropertyGroup></Project>
So it seems to be targeting for a netStandard2.0 (which includes netFramework 4.6.1 to netCore 2.2?)
Am I missing something simple?
After googling around with nu1202 and netStandard2.0 - which mostly came up with a scenario of A being a library and B being an application, not a B being a library like my situation - I present:
Things I've Tried Based on Dissimilar Problems
- Confirm the dotnet --version of each of the A / B projects, both at 3.1.402
- Confirmed my Nuget Package Mangaer version is fairly recent / up to date: 5.7.0
- Attempted to use the Package Manager Console to the exact same result.
- Cleaned and Rebuilt / Packed the A.csproj
- Tried including the A.nuspec file in the Package Source folder with A.nupkg
- Pulled the A.csproj manually into the project to confirm it could be added as a Project Reference which worked, but isn't how I want to solve this problem.
I've maybe tried more but at this point, maybe the question I should be asking is: Is it possible to reference netStandard libraries inside of other netStandard libraries?
What am I missing?