dotnet / buildtools

Build tools that are necessary for building the .NET Core projects
477 stars 240 forks source link

Unable to upgrade a package from netcoreapp to netstandard as netstandard adds APIs. #2264

Closed jhudsoncedaron closed 3 years ago

jhudsoncedaron commented 5 years ago

When trying to make a multi-library targeting both netcoreapp and netstandard, the dotnet dependency resolver does something surprising. It prefers any arbitrary old version of netcoreapp over a very new version of netstandard.

So when netstandard adds enough apis that we can switch from netcoreapp to netstandard, it doesn't work. It actually prefers the really old netcore version over the netstandard version.

I went back and tried it on the 2.1 tooling and it's been doing it for awhile.

Demonstration:

netcoreresolve.zip

Expected output: "Moniker: netstandard2.0" Actual output: "Moniker: netcoreapp1.0"

I have some long-running multi-target libraries where I actually have to knock out features at build time when targeting old platforms, so this behavior is obnoxious.

dagood commented 5 years ago

This repo contains some tools that were used to build repos like CoreCLR and CoreFX, and it's not part of the .NET Core SDK. It looks like this issue belongs somewhere like the https://github.com/dotnet/sdk repo. There's also https://github.com/dotnet/core for a wide audience, if it's not clear where the issue fits.

Nobody really monitors dotnet/buildtools, but I happened to click the issues tab here and saw this.

jhudsoncedaron commented 5 years ago

@dagood : I had to guess.

ViktorHofer commented 3 years ago

// Auto-generated message

Going forward, the .NET team is using https://github.com/dotnet/arcade to develop the code and issues formerly in this repository. Feel free to reopen/move this issue if it still applies to servicing branches in this repository, or source code which now resides in the Arcade repository.