-1

While migrating to net6 in company we want to habe some libraries for netstandard2.0 and net6 as well. (we skipped shorttime support net5)

Having a library as local reference: as well. Having the library as proprietary nuget source: Problem referencing System.Runtime

Referencing the library from a project, having netCore3.1 as Framework

... uses 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ...

But there exists no System.Runtime in nuget.

The multitarget Lib is deployed in a docker container.

  • Is there something missing?
anarxz
  • 817
  • 1
  • 14

1 Answers1

0

If it helps anyone I found that both netstandard2.0 and net6.0 libraries were targeting net6.0 (Can see this in dotPeek). Instead of one targeting 6 and one targeting 2.0. Problem was the build command had an output folder so both frameworks were outputted to the same location, meaning one overwrote the other.

dotnet build "****" -c Release -o /app/build

Should be

dotnet build "****" -c Release
Anish
  • 1
  • 1