It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to setup pipeline for .Net Core 3.1

Can someone suggest what to do to set up a pipeline for .Net Core 3.1. I've tried a couple of images that I found through "docker search" and on the Microsoft support site but the build is still failing. My current .yml code is below:

image: mcr.microsoft.com/dotnet/core/sdk:3.1

pipelines:
default:
- step:
caches:
- dotnetcore
script: # Modify the commands below to build your repository.
- zip applicationapi.zip
- export PROJECT_NAME=FitnessWebApplication
- export TEST_NAME=FitnessWebApplication.test
- dotnet restore
- dotnet build $PROJECT_NAME
#- dotnet test $TEST_NAME
- pipe: atlassian/heroku-deploy:1.1.2
variables:
HEROKU_API_KEY: 'X'
HEROKU_APP_NAME: 'fitnesswebapplicationapi'
ZIP_FILE: 'applicationapi.zip'

I've also tried the microsoft/dotnet and appsvc/dotnetcore images. csproj file is below:

 <ItemGroup> <PackageReference Include="AutoMapper" Version="9.0.0" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0" /> <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" /> <PackageReference Include="MongoDB.Bson" Version="2.10.0" /> <PackageReference Include="MongoDB.Driver" Version="2.10.0" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.2.2" /> </ItemGroup>

 

2 answers

Hi Kyle, I'm not sure if you came right, but you can use this (https://hub.docker.com/_/microsoft-dotnet-core-sdk/) image: mcr.microsoft.com/dotnet/core/sdk:3.1

I've tried that image previously, cited it in op. image still doesn't work properly.

What's the error you're getting?

When I try to build, all that pings back is "something went wrong," not a useful error I know but that's all that Bitbucket is giving me. 

You should try to eliminate the heroku part and try only building your project first. 

Once you have a successful build, then add the extra commands you need.  

 

I'm not sure if this would help, but this is my yml file with just the basic build of a project. 

image: mcr.microsoft.com/dotnet/core/sdk:3.1

pipelines:
default:
-
step:
caches:
-
dotnetcore
script:
# Modify the commands below to build your repository.
-
dotnet build ZT.Web.Main/ZT.Web.Main.csproj
Like # people like this

@Lee Venkatsamy Do you know how I get assistance from an Atlassian Member?

Don't know bud.. Kinda dumb that we are paying for something, but don't receive support.

Like # people like this

Don't you have a console log similar to this? where you can see which line the error is occurring?  

2020-03-18 08_12_45-Clipboard.png

The ping back I'm getting is before that step. I do know what you're referencing bc of the other pipeline I made for the UI but the error message I get is before the build begins as if its a yml error. Yet no status code or anything. 

Is it possible for an @Atlassian team member to assist here? 

Like Kyle_Davis likes this

Did you get this to work? I get an error bash: zip: command not found

@Paresh_Bijarane What is the status of this issue?

@jnyingi I switched to Azure Pipeline considering limitations of Bitbucket for .Net.

Suggest an answer

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

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,034 views 0 3
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