Azure DevOps VSTS .netcore build failing, but works fine on my PC

后端 未结 3 401
误落风尘
误落风尘 2021-01-18 06:15

I keep getting dependencies errors in my .net core2.1.1 MVC website. It builds fine from my PC. but Azure DevOps is not compiling refrences properly.

Adding

相关标签:
3条回答
  • 2021-01-18 06:27

    Solved it Edit 7/5/19 The YML file or the editor has the same issue with the .netcore SDK version. I have updated mine multiple times now. It will break randomly when the core SDK team pushes updates to Nuget, or you update VS or sometimes.. My builds are automated and it works today and tomorrow it does not, after 0 code changes. But I always come back to this fix and then it builds again.

    Get your SDK version in VS2017

    Set your version in DevOps

    0 讨论(0)
  • 2021-01-18 06:30

    For those of you configuring through a YAML file: I was dealing with these issues too but it was because I simply copied a deployment YAML file from somewhere else and did not use the proper tooling. After following this tutorial, it worked like a charm:

    https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=azure-devops

    More specifically, I think using the dotnet restore to restore your packages might fix it:

    steps:
    - script: dotnet restore
    

    Make sure to install the correct .NET Core SDK, too.

    steps:
    - task: DotNetCoreInstaller@0
      inputs:
        version: '2.1.300' # replace this value with the version that you need for your project
    
    0 讨论(0)
  • 2021-01-18 06:38

    I would suggest checking the following 2 items:

    1. Build in RELEASE locally and see if the problem is reproduced.
    2. Be specific about NuGet version in VSTS:

    0 讨论(0)
提交回复
热议问题