Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with restoring nuget packages with asp.net core 2.2

I successfully update my projects to netcoreapp2.2. I can restore nuget packages and build the projects without any problems. I use CD/CI and on the build server I receive error message when I restore the nugets. These is from the log:

2018-12-14T12:35:33.4556576Z ##[error]The nuget command failed with exit code(1) and error(NU1607: Version conflict detected for Microsoft.AspNetCore.Authentication.Abstractions. Reference the package directly from the project to resolve this issue. PM.Service.API (>= 1.0.0) -> Microsoft.AspNetCore.Mvc.Formatters.Xml (>= 2.2.0) -> Microsoft.AspNetCore.Mvc.Core (>= 2.2.0) -> Microsoft.AspNetCore.Authorization.Policy (>= 2.2.0) -> Microsoft.AspNetCore.Authentication.Abstractions (>= 2.2.0) PM.Service.API (>= 1.0.0) -> Microsoft.AspNetCore.App (>= 2.1.0) -> Microsoft.AspNetCore.Authentication.Abstractions (>= 2.1.0). NU1607: Version conflict detected for Microsoft.AspNetCore.Hosting. Reference the package directly from the project to resolve this issue. TM.Service.API (>= 1.0.0) -> Microsoft.AspNetCore.Hosting.WindowsServices (>= 2.2.0) -> Microsoft.AspNetCore.Hosting (>= 2.2.0) TM.Service.API (>= 1.0.0) -> Microsoft.AspNetCore.App (>= 2.1.0) -> Microsoft.AspNetCore.Hosting (>= 2.1.0).

In my project I have these package references:

How can I resolve this issue? Thanks

like image 995
Dim_Ka Avatar asked Dec 05 '25 23:12

Dim_Ka


1 Answers

Thank you for your answers. I found the problem. I have a task "NuGet Tool Installer" in my CD process. I update the version of nuget.exe from 4.3.0 to 4.8.1 and now it works. Thank you

like image 102
Dim_Ka Avatar answered Dec 08 '25 13:12

Dim_Ka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!