Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,559,207
Community Members
 
Community Events
184
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

1 answer

Hi @srinidhi ,

We also encountered this issue, and the current work around the adapted is to use dotnet-install.sh script to install another version of dotnet sdk in the script.

Before you run dotnet restore and build, run below script to download dotnet-install.sh and use it to download and install sdk version 3.1.

- curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -Channel 3.1 -Runtime dotnet -InstallDir /usr/share/dotnet

 Hope this helps.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events