Build failing with not being able to restore workerExtension.csproj

Ash 75 Reputation points Microsoft Employee
2024-09-19T15:37:05.55+00:00

Hi, We are encountering a transient error in our cloud build pipeline. When attempting to restore packages for our Azure Function, we receive the following errors:

D:\dbs\sh\aac6\temp\0mjoggt1.c2j\WorkerExtensions.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
D:\dbs\sh\aac6\temp\0mjoggt1.c2j\WorkerExtensions.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
D:\dbs\sh\aac6\temp\0mjoggt1.c2j\WorkerExtensions.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.js
on.

We had tried the hack as mentioned in https://github.com/Azure/azure-functions-dotnet-worker/issues/1252 to have seperate project adding the required dependencies and it had worked. However, the problem has resurfaced in the past two weeks. Could someone please assist us with this issue?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,977 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,839 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 4,290 Reputation points Microsoft Employee
    2024-09-20T08:52:07.97+00:00

    Hello @Ash

    The error message indicates that it is unable to load the service index for the NuGet package source. This could be due to a transient network issue or a problem with the NuGet package source itself.

    One thing you could try is to clear the NuGet cache on the build agent machine to see if that resolves the issue. You can do this by running the following command: dotnet nuget locals all --clear

    If that doesn't work, you could try specifying a different NuGet package source in your project's NuGet.config file.

    I hope this helps.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.