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

Error on dotnet build

floriantreier May 12, 2017

Hi everyone

I am trying to get the BitBucket pipeline up and running. I have found this article and I tried to follow it. But on dotnet build I always get the error "Couldn't find 'project.json' in current directory".

I have a very basic program and structure:

root
|-TestApp
| |-TestApp.sln
| |-TestApp.csproj
| |-Program.cs
| |-program.json
|-bitbucket-pipelines.yml

The bitbucket-pipelines.yml looks as follows:

image: microsoft/dotnet:onbuild

pipelines:
  default:
    - step:
        script: # Modify the commands below to build your repository.
          - dotnet restore
          - dotnet build

Any idea what I am missing?

1 answer

1 accepted

4 votes
Answer accepted
Ciaran Grimes May 15, 2017

Hi,

I had the same problem so thought I'd let you know what I did. The image "microsoft/dotnet:onbuild" looks for a project.json file in the project root but project.json has been deprecated in .NET Core projects and moved to csproj - https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json-to-csproj.

So I'm guessing you just don't have the file it is looking for.

I found another thread where this was being talked about and the advice given there was to use a different image:

image: microsoft/dotnet:1.1-sdk

This worked fine for me, original thread - http://stackoverflow.com/questions/42981831/net-core-bitbucket-pipeline-builds-fail-wants-project-json-when-i-have-cspro

Hope this helps!

 

floriantreier May 30, 2017

Hi,

Thank you for your answer. It helped a lot.

re_al_ January 5, 2018

Hi!!

Thanks a lot!!

Josh January 10, 2018

I was also facing this issue and it was because the project was using .NET Framework 4.x which isn't available with Pipelines. The solution is to instead use .NET Core.

Like Josh Schoenfeld likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events