0

task: upgrade services from .netcore31 to .net6

the idea: creating MTF-libraries referencing net6 and (netcore31 or netstandard21)

how: jenkins, docker on linux

Dockerfile

FROM mcr.microsoft.com/dotnet/sdk:6.0 as build
copy --FROM=mcr.microsoft.com/dotnet/core/sdk:3.1 /usr/share/dotnet/shared /usr/share/dotnet/shared

building and using the created MTF library - all is well

the trouble: using the library created by Jenkins job fails

Error   CS1705  Assembly '...***...* 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'

any ideas? What is missing on docker or jenkins?

1 Answers1

0

If it helps anyone I found that both netcore3.1 and net6.0 libraries were targeting net6.0 (Can see this in dotPeek). Instead of one targeting 6 and one targeting 3.1. 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