Fixing NuGet error: Unable to load the service index for source - 401 Unauthorized

Fixing NuGet error: Unable to load the service index for source - 401 Unauthorized

Setting up an entirely new project and getting things off the ground is usually the quickest part of our development process for a project. However, not its not uncommon to stumble into various issues with NuGet, if you're a dotnet dev. Something I've ran into several times is when running dotnet restore or dotnet add package <name>, the tool throws and error with Unauthorized. Similar to the below message. dotnet restore Determining projects to restore... All projects are up-to-date for restore. DragonFruit -v 0.3.0-alpha.20574.7 Determining projects to restore... Writing C:\Users\tobia\AppData\Local\…

Read More

Solution: Unable to find .deps.json when running .NET 5 tests in Azure DevOps

Solution: Unable to find .deps.json when running .NET 5 tests in Azure DevOps

I recently upgraded some projects to .NET 5 from the previous .NET Core 3.x versions I had running. My projects utilize xUnit, and I run them from Azure DevOps. However, when I upgraded my projects, and modified the build definition accordingly with the latest NuGet installer, and the latest .NET 5 SDK, I got a new exception: ##[error]Unable to find D:\a\1\s\src\projectname\bin\Debug\net5.0\ref\projectname.deps.json. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". Looking closely on the path, it mentions a…

Read More

Close You've successfully subscribed to Tobias Zimmergren's thoughts on tech.
Close Great! You've successfully signed up.
Close Welcome back! You've successfully signed in.
Close Success! Your account is fully activated, you now have access to all content.