Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Installing a netstandard2.0 Nuget Package inside a different netstandard2.0 library NU1202

$
0
0

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

  1. Confirm the dotnet --version of each of the A / B projects, both at 3.1.402
  2. Confirmed my Nuget Package Mangaer version is fairly recent / up to date: 5.7.0
  3. Attempted to use the Package Manager Console to the exact same result.
  4. Cleaned and Rebuilt / Packed the A.csproj
  5. Tried including the A.nuspec file in the Package Source folder with A.nupkg
  6. 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?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>