2
votes

Builds fine locally but getting following error on VSTS build server. Issue is clear but not able to resolve it.

018-07-18T19:41:24.6993903Z ##[error]The nuget command failed with exit code(1) and error(NU1107: Version conflict detected for Microsoft.AspNetCore.Http.Abstractions. Reference the package directly from the project to resolve this issue. 
 webapi.admin -> Microsoft.AspNetCore.Cors 2.1.1 -> Microsoft.AspNetCore.Http.Extensions 2.1.1 -> Microsoft.AspNetCore.Http.Abstractions (>= 2.1.1) 
 webapi.admin -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Http.Abstractions (= 2.1.0).
3

3 Answers

1
votes

Can you upgrade Microsoft.AspNetCore.App to version 2.1.1?

Or just upgrade all your nuget references to the latest version? (2.1.2 for these)

As for building locally working, try cleaning, or create a fresh clone of the source control repo and see if that works.

0
votes

Explicitly setting the version attribute resolved it, changed:

<PackageReference Include="Microsoft.AspNetCore.App" /> to

<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />

More details here: https://github.com/aspnet/Universe/issues/1180#issuecomment-392180608

0
votes

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