C
C#3w ago
Suro

✅ [Solved] Dotnet restore is failing on new apps

I'm working with the CLI on linux. Any new app I create (console, web api, etc) running dotnet restore fails like this:
Build FAILED.

"/home/suren/test/test.csproj" (Restore target) (1) ->
(Restore target) ->
/usr/share/dotnet/sdk/8.0.106/NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/suren/test/test.csproj]
/usr/share/dotnet/sdk/8.0.106/NuGet.targets(156,5): error : The HTTP request to 'GET https://api.nuget.org/v3/index.json' has timed out after 100000ms. [/home/suren/test/test.csproj]

0 Warning(s)
1 Error(s)
Build FAILED.

"/home/suren/test/test.csproj" (Restore target) (1) ->
(Restore target) ->
/usr/share/dotnet/sdk/8.0.106/NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/suren/test/test.csproj]
/usr/share/dotnet/sdk/8.0.106/NuGet.targets(156,5): error : The HTTP request to 'GET https://api.nuget.org/v3/index.json' has timed out after 100000ms. [/home/suren/test/test.csproj]

0 Warning(s)
1 Error(s)
I have an existing project I pulled from github, dotnet restore works fine on it. Anyone know what is going on?
20 Replies
Suro
Suro3w ago
I found this https://learn.microsoft.com/en-us/answers/questions/926095/using-dotnet-6-on-arch-linux but my NuGet.config is fine:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Using dotnet 6 on Arch linux - Microsoft Q&A
Hello!
I have an issue with running dotnet apps on my arch linux system. A have installed packages that I need (dotnet-runtime and dotnet-sdk) so I can use dotnet in may terminal. Now I can create apps. But I can't run them. There is some problems…
Pobiega
Pobiega3w ago
error : The HTTP request to 'GET https://api.nuget.org/v3/index.json' has timed out after 100000ms.
that seems to be the core problem thats a json file it needs to be able to get for things to work.
Suro
Suro3w ago
yes, so why isn't it lol
Pobiega
Pobiega3w ago
thats for you to figure out I'm afraid. try the standard network debugging stuff - test on a secondary device, check DNS records, check IP connectivity, etc
Suro
Suro3w ago
lmfao this is not an actual networking issue, i can curl that json no problem
Pobiega
Pobiega3w ago
well its not a dotnet problem either
Suro
Suro3w ago
good take
Pobiega
Pobiega3w ago
Well yeah. dotnet restore is used by millions of people every day, a very large number of those are linux users, and a non-trivial portion of those are arch users it has to be something with your setup/configuration/system its not the binary itself
reflectronic
reflectronic3w ago
does dotnet restore --disable-parallel help
Suro
Suro3w ago
nah, i tried it, i also tried uninstalling host and sdk and doing a fresh reinstall i had a friend on arch linux confirm it breaks same way for him, he also tried it on a ubuntu docker container and reproduced it there is the new cli just broken on linux?
Trace
Trace3w ago
Are you using the AUR or the Extra repo one or dotnet-install?
Suro
Suro3w ago
i have uninstalled / reinstalled to try both right now i have the -bin ones from AUR i actually spun up a virtualbox opensuse vm to try it there and it worked but not sure wtf is going on in arch
Trace
Trace3w ago
Works fine for me Have you installed the host?
Suro
Suro3w ago
i have dotnet-host-bin 8.0.6.sdk302-1 before i tried the aur ones i had the official host
Trace
Trace3w ago
Try running with --verbosity detailed To get more info @🍆
Suro
Suro3w ago
i had done that, didn't tell me much more but maybe you can make sense of it cya in 100000ms @Trace unfortunately it just looks like a normal restore until the error https://pastebin.mozilla.org/BXN9ycrX
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Suro
Suro3w ago
...whoops so uninstalling / reinstalling from the official packages or the binaries from AUR did nothing to help but just doing a manual install
Suro
Suro3w ago
Install .NET on Linux without using a package manager - .NET
Demonstrates how to install the .NET SDK and the .NET Runtime on Linux without a package manager. Use the install script or manually extract the binaries.
Suro
Suro3w ago
worked thanks guys