Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build .NET Core 3.0 on Azure Pipelines

Yes, I know .NET Core 3.0 is still in preview. I would like to build this on Azure Pipelines.

Is there an easy way to do this?

Currently getting this error:

/usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0.

edit

I found official documentation about this:

https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=azure-devops

like image 335
KoalaBear Avatar asked Jun 13 '19 05:06

KoalaBear


People also ask

How do I install .NET framework in Azure pipeline?

Sign in to Azure PipelinesAfter you sign in, your browser goes to https://dev.azure.com/my-organization-name and displays your Azure DevOps dashboard. Within your selected organization, create a project. If you don't have any projects in your organization, you see a Create a project to get started screen.

Does Azure pipeline support .NET 6?

Since it is a continuous deployment pipeline, upon every code commit to the Git repo this pipeline deploys the . NET 6 API Code to the Azure app service.


1 Answers

You can install the .Net core SDK 3.0 during the pipeline with .Net Core SDK Installer task:

- task: UseDotNet@2   displayName: 'Install .net core 3.0 (preview)'   inputs:     packageType: sdk     version: '3.0.100-preview6-012264'     installationPath: $(Agent.ToolsDirectory)/dotnet 

I specified the last preview version of .net core sdk 3.0, you can put an earlier version, you can find here the versions list.

Another option is to specify 3.0.x and enable the preview versions:

version: 3.0.x includePreviewVersions: true 

Installation results:

enter image description here

like image 78
Shayki Abramczyk Avatar answered Nov 04 '22 00:11

Shayki Abramczyk