0

I am doing a docker build with a RUN step that does a dotnet publish. The error appears to indicate that dotnetcore 3.0 does not support netstandard2.1 (which is incorrect according to https://learn.microsoft.com/en-us/dotnet/standard/net-standard).

Why am I getting this error?

$ docker build -t Blah/api -f ./Blah.Api/Dockerfile --build-arg Blah_version=0.0.0 --build-arg Blah_build_num=${buildNum} .
Sending build context to Docker daemon  32.78MB

Step 1/14 : FROM microsoft/dotnet:3.0-sdk AS build-env
 ---> a4b0ceb74bae
...
...
Step 6/14 : RUN dotnet restore ./Blah.Api/Blah.Api.csproj  && dotnet publish ./Blah.Api/Blah.Api.csproj --no-restore --configuration=Release --framework=netcoreapp3.0 /p:AssemblyVersion=${Blah_version}.${Blah_build_num} --output=/app/out
 ---> Running in e1f8563f8bf3
/usr/share/dotnet/sdk/3.0.100-preview-010184/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(155,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Standard 2.1.  Either target .NET Standard 2.0 or lower, or use a version of the .NET SDK that supports .NET Standard 2.1. [/app/Blah.Integration.Chains/Blah.Integration.Chains.csproj]
Joe Phillips
  • 49,743
  • 32
  • 103
  • 159

0 Answers0