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

Build fails on BB, but not locally

Neil Scales April 10, 2024

I am building a .net core 6 project.  I've added a fairly complex .editorconfig file, which is only causing problems building on the BB build server.

I get zero build problems if I build from Visual Studio, or `dotnet build` on the command line.  When I run exactly the same dotnet build command in the bitbucket-pipeline.yml, I get build errors (specifically IDE0055, but I've fixed others already).

I've also tried using the official .net6 sdk docker image locally, and I get no errors.  

It appears to be a problem with the BB build server, but I'm stuck for ideas.

 

bitbucket-pipeline.yml (snippet):

image: mcr.microsoft.com/dotnet/sdk:6.0

script:
- dotnet restore $SOLUTION_NAME.sln
- dotnet build --no-restore --configuration Debug $SOLUTION_NAME.sln 

1 answer

1 accepted

1 vote
Answer accepted
Neil Scales April 11, 2024

If anyone else gets this issue, it's to do with line endings.

 

.gitattribute

text=auto

This will change the line endings to match the OS.

 

.editorconfig

end_of_line = CRLF

 

This forces to always use Windows line endings.

 

This will fail the build because the builds are Linux, but the config says it should be Windows.

 

The answer is:

end_of_line = unset

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events