I have the following simple pipeline defined for my Asp.Net Core project:
image: microsoft/dotnet:latest
stages:
- build
- test
variables:
test: "Testing"
before_script:
- "cd *my folder with projects*"
- "dotnet restore"
build:
stage: build
script:
- "dotnet build"
test:
stage: test
script:
- "dotnet test"
When I tried to run it against my project, it failed with an exit code 1 and a message:
/usr/share/dotnet/sdk/2.1.803/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1.
Try setting the image to
mcr.microsoft.com/dotnet/core/sdk:3.1
That should use the .NET Core 3.1 SDK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With