Skip to main content

Azure DevOps NuGet error

When trying to restore a NuGet package inside an Azure DevOps Build it failed with the following error message:

2019-11-13T09:17:59.8686867Z ##[section]Starting: NuGet restore

2019-11-13T09:17:59.8813825Z ==============================================================================

2019-11-13T09:17:59.8813825Z Task         : NuGet Installer

2019-11-13T09:17:59.8813825Z Description  : Installs or restores missing NuGet packages

2019-11-13T09:17:59.8813825Z Version      : 0.2.31

2019-11-13T09:17:59.8813825Z Author       : Microsoft Corporation

2019-11-13T09:17:59.8813825Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)

2019-11-13T09:17:59.8813825Z ==============================================================================

2019-11-13T09:18:01.6050815Z [command]C:\Windows\system32\chcp.com 65001

2019-11-13T09:18:01.6050815Z Active code page: 65001

2019-11-13T09:18:01.6070347Z Detected NuGet version 3.3.0.212 / 3.3.0

2019-11-13T09:18:01.6080113Z SYSTEMVSSCONNECTION exists true

2019-11-13T09:18:01.6080113Z [command]D:\b\4\agent\_work\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe restore -NonInteractive D:\b\4\agent\_work\59\s\MestbankPortaal.sln -ConfigFile D:\b\4\agent\_work\59\s\nuget.config

2019-11-13T09:18:02.1119369Z MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.

2019-11-13T09:18:02.4713257Z Feeds used:

2019-11-13T09:18:02.4713257Z   C:\Users\tfsservice\AppData\Local\NuGet\Cache

2019-11-13T09:18:02.4713257Z   C:\Users\tfsservice\.nuget\packages\

2019-11-13T09:18:02.4713257Z   http://tfs:8080/tfs/DefaultCollection/_packaging/Feed/nuget/v3/index.json

2019-11-13T09:18:02.4713257Z   C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

2019-11-13T09:18:02.4713257Z

2019-11-13T09:18:02.4986705Z Restoring NuGet package IAM.Security.2.6.1.

2019-11-13T09:18:45.2347882Z WARNING: Unable to find version '2.6.1' of package 'IAM.Security'.

2019-11-13T09:18:45.2572523Z Unable to find version '2.6.1' of package 'IAM.Security'.

2019-11-13T09:18:45.2816698Z ##[error]Error: D:\b\4\agent\_work\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1

2019-11-13T09:18:45.2816698Z ##[error]Packages failed to install

2019-11-13T09:18:45.2855766Z ##[section]Finishing: NuGet restore

This was a package that was recently added to our private Azure Artifacts feed, but I was able to restore it without any problem on my local machine.

Eventually I found out that I could solve the problem by increasing the NuGet version used by the build process to version 4:

Popular posts from this blog

.NET 8–Keyed/Named Services

A feature that a lot of IoC container libraries support but that was missing in the default DI container provided by Microsoft is the support for Keyed or Named Services. This feature allows you to register the same type multiple times using different names, allowing you to resolve a specific instance based on the circumstances. Although there is some controversy if supporting this feature is a good idea or not, it certainly can be handy. To support this feature a new interface IKeyedServiceProvider got introduced in .NET 8 providing 2 new methods on our ServiceProvider instance: object? GetKeyedService(Type serviceType, object? serviceKey); object GetRequiredKeyedService(Type serviceType, object? serviceKey); To use it, we need to register our service using one of the new extension methods: Resolving the service can be done either through the FromKeyedServices attribute: or by injecting the IKeyedServiceProvider interface and calling the GetRequiredKeyedServic...

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

Kubernetes–Limit your environmental impact

Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t...