Error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json

Neo 421 Reputation points
2023-02-23T02:56:46.1166667+00:00

I just created a new WINUI3 project and tried to build it. Got the following error:

Error NU1301 Unable to load the service index for source https://api.nuget.org/v3/index.json

When I try curl https://api.nuget.org/v3/index.json, I get:

<head><title>Document Moved</title></head>

<body><h1>Object Moved</h1>This document may be found <a HREF="https://nuget.cdn.azure.cn/v3/index.json">here</a></body>

Then I try curl -L https://api.nuget.org/v3/index.json, I get:

curl: (6) Could not resolve host: nuget.cdn.azure.cn

This is really awkward. I live in China, I always have problems with network connections with many foreign websites. Is there any workaround over this?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,425 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Neo 421 Reputation points
    2023-02-23T07:50:49.32+00:00

    Okay, I have to live with it. It works for a while and then it does not. I have no way to control it.


  2. Shaun Chen 21 Reputation points
    2023-04-19T06:42:44.4766667+00:00

    What you can do is try to avoid using nuget mirror in China. You can try to resolve api.nuget.org here: https://boce.aliyun.com/detect/dns or https://www.gdnspc.com/ Then you can write the result to your machine's hosts fine.

    0 comments No comments

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.