We use a msbuild-sonar-scanner
image to run some tests on a .net
application.
Within the Dockerfile
that builds the sonar-scanner
image, at some point we perform:
&& echo "deb http://download.mono-project.com/repo/debian stretch main" | tee /etc/apt/sources.list.d/mono-official.list \
&& curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \
&& mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg \
&& sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/dotnetdev.list' \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
dotnet-sdk-2.1.4 \
However, the tests execution produce the following error
/usr/share/dotnet/sdk/2.1.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.TargetFrameworkInference.targets(135,5): error : The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 2.0 or lower, or use a version of the .NET SDK that supports .NET Core 2.1. [/builds/enorasys-ss/essapi/src/socstreamsAPI/EssApi.csproj]
How is this possible, given that we use a 2.1.4
version of the dotnet-sdk
and since this is the latest version available from the debian repos:
$ sudo apt-cache search dotnet | grep dotnet-sdk
dotnet-sdk-2.0.0 - Microsoft .NET Core SDK - 2.0.0
dotnet-sdk-2.0.2 - Microsoft .NET Core SDK - 2.0.2
dotnet-sdk-2.0.3 - Microsoft .NET Core SDK - 2.0.3
dotnet-sdk-2.1 - Microsoft .NET Core SDK 2.1.401
dotnet-sdk-2.1.101 - Microsoft .NET Core SDK - 2.1.101
dotnet-sdk-2.1.103 - Microsoft .NET Core SDK - 2.1.103
dotnet-sdk-2.1.104 - Microsoft .NET Core SDK - 2.1.104
dotnet-sdk-2.1.105 - Microsoft .NET Core SDK - 2.1.105
dotnet-sdk-2.1.2 - Microsoft .NET Core SDK - 2.1.2
dotnet-sdk-2.1.200 - Microsoft .NET Core SDK - 2.1.200
dotnet-sdk-2.1.201 - Microsoft .NET Core SDK - 2.1.201
dotnet-sdk-2.1.202 - Microsoft .NET Core SDK - 2.1.202
dotnet-sdk-2.1.3 - Microsoft .NET Core SDK - 2.1.3
dotnet-sdk-2.1.300-preview2-008533 - Microsoft .NET Core SDK 2.1.300 - Preview
dotnet-sdk-2.1.300-rc1-008673 - Microsoft .NET Core SDK 2.1.300 - rc1
dotnet-sdk-2.1.4 - Microsoft .NET Core SDK - 2.1.4