Home Fixing NuGet.targets(131,5) error The local source doesn't exist
Post
Cancel

Fixing NuGet.targets(131,5) error The local source doesn't exist

Today, I was trying to add a new NuGet package to my .NET 5 project and I got the following error message: C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error : The local source ‘C:\Users\Wolfgang\Desktop\poc-microservice-main\ProductService\ProductService.Catalog’ doesn’t exist. I know that the file doesn’t exist because I deleted it weeks ago after helping a reader of my blog.

Installing a NuGet package failed

Installing a NuGet package failed

I was quite annoyed by the error message because and I couldn’t find out what was wrong. Also checking the mentioned NuGet.targets file didn’t helpt me. Fortunately the solution was quite simple.

Open a PowerShell window and enter the following code:

This creates a new nuget.config file and fixed the problem for me.

Create a new NuGet config file

Create a new NuGet config file

This post is licensed under CC BY 4.0 by the author.

Use Infrastructure as Code to deploy your Infrastructure with Azure DevOps

Debug Microservices running inside a Kubernetes Cluster with Bridge to Kubernetes

Comments powered by Disqus.