Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,920
Community Members
 
Community Events
165
Community Groups

how to set up bitbucket pipeline to build .Net core 5.0 project

Exploring bitbucket pipeline to create a CI/CD for a .net 5.0 microservice project. Please find the .yml file below

 

pipelines:
branches:
POR-2191:
- step:
name: Build MicroService
caches:
- dotnetcore
image: mcr.microsoft.com/dotnet/sdk:5.0
script:
- export PROJECT_NAME=MyProjectName
- dotnet restore
- dotnet build $PROJECT_NAME

 But I am seeing this error when the pipeline runs,


Error:

dotnet build $PROJECT_NAME
+ dotnet build $PROJECT_NAME
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored /tmp/10vu21df.v2w/WorkerExtensions.csproj (in 1.42 sec).
WorkerExtensions -> /tmp/10vu21df.v2w/buildout/Microsoft.Azure.Functions.Worker.Extensions.dll
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : It was not possible to find any compatible framework version [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : The framework 'Microsoft.NETCore.App', version '3.1.0' was not found. [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : - The following frameworks were found: [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : 5.0.12 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : You can resolve the problem by installing the specified framework and/or SDK. [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : The specified framework can be found at: [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=debian.10-x64 [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
/root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Metadata generation failed. [/tmp/10vu21df.v2w/WorkerExtensions.csproj]
Build FAILED.
Looks like it also needs .net 3.1.0. But not sure how to do it. Tried by including Services like below but no luck.
definitions:
services:
sdk:
image: mcr.microsoft.com/dotnet/core/sdk:3.1

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,263 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you