evan.c
evan.c

Reputation: 3

Nuget Error NU1605 in Azure Pipeline deployment for project reference

I have been trying to update my Business Logic Layer dll for an Azure Functions project. Everything seems to work fine on my local machine when I build/restore nuget packages, however when I push it up to be deployed via Azure Pipelines using our IAC it fails with the nuget code NU1605.

Essentially I have multiple functions in multiple projects so the structure kind of looks like this:

Function1 -Reference-> Common(for DI)
Function2 -Reference-> Common
Function1 -Reference-> BLLDLL
Function2 -Reference-> BLLDLL
Common -Reference-> BLLDLL

And this is what it looks like in the console on failing

   (Restore target) -> 

     /home/vsts/work/1/s/Function1.csproj : error NU1605: Detected package downgrade: BusinessLogic from 1.19 to 1.17. Reference the package directly from the project to select a different version. 
   /home/vsts/work/1/s/Function1.csproj : error NU1605:  Function1 -> Common -> BusinessLogic (>= 1.19) 
   /home/vsts/work/1/s/Function1.csproj : error NU1605:  Function1  -> BusinessLogic (>= 1.17)

Function1 has been updated to 1.19, so I'm not sure what it's complaining about here. Common does restore properly, and I even tried to split out Common to restore and build in our YAML first, thinking that it was because the project DLL hadn't been built yet, but that didn't do anything. I'm sure I'm missing something small, our other solution has the same structure and isn't failing. I'm happy to try and provide more information if needed but I'm stumped.

Upvotes: 0

Views: 1193

Answers (2)

evan.c
evan.c

Reputation: 3

I figured it out, somehow old versions of our csproj files before the restructuring of our solution made their way back into the master branch of our source and were being picked up by the YAML.

Upvotes: 0

Leo Liu
Leo Liu

Reputation: 76760

Nuget Error NU1605 in Azure Pipeline deployment for project reference

Just as the error message shows:

Function1.csproj : error NU1605:  Function1 -> Common -> BusinessLogic (>= 1.19) 
Function1.csproj : error NU1605:  Function1  -> BusinessLogic (>= 1.17)

So, The project Function1.csproj directly references the low version nuget package BusinessLogic (>= 1.17), but indirectly references the high version nuget package BusinessLogic (>= 1.19). That will cause the error NU1605: Detected package downgrade.

To resolve this issue, we need update the directly references BusinessLogic (>= 1.17) to the version 1.19 for the project Function1.csproj in the local, then submit this change to the Azure repo.

Upvotes: 1

Related Questions