I'm trying to create an ASP.NET Core Web API project on my Linux system (Ubuntu 22.04) and facing an issue with the dotnet restore or dotnet new command: the process gets stuck during the restore step. Im using the dotnet new webapi -o NewApi command (SDK 8.0).
Determining projects to restore...
/home/john/project-folder/webapp/MyWebApi.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
Failed to restore /home/john/project-folder/webapp/MyWebApi.csproj (in 10.09 min).
Has anyone encountered this issue before? Any ideas on how to resolve it?
Additional context:
I’ve tried creating other project types (e.g., console apps), and they work fine. The issue seems specific to Web API projects.
I confirmed that my connection to NuGet works by running:
curl https://api.nuget.org/v3/index.json
This returns a valid JSON response, so there’s no issue with network connectivity.
