dotnet new project can't restore it's dependencies
See original GitHub issueSteps to reproduce
install the latest dotnet cli (x64 windows). open a console create a directory “helloworld” (e.g. c:\users{yourname}\documents\helloworld - no spaces in path)
dotnet new
dotnet restore
Expected behavior
Restore packages so that dotnet run will run the app
Actual behavior
log : Restoring packages for C:\Users\shawn\Documents\helloworld\project.json...
error: Unable to load the service index for source https://www.myget.org/F/aspnetvnext/api/v3/index.json.
error: An error occurred while sending the request.
error: The server name or address could not be resolved
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-rc2-002416)
Product Information:
Version: 1.0.0-rc2-002416
Commit Sha: 37f00f24e9
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
nuget.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="RC2" value="https://www.myget.org/F/aspnetvnext/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
<disabledPackageSources>
</disabledPackageSources>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<activePackageSource>
<add key="RC2" value="true" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
<apikeys>
<add key="https://www.nuget.org" value="..." />
<add key="http://nuget.gw.symbolsource.org/Public/NuGet" value="..." />
</apikeys>
</configuration>
Issue Analytics
- State:
- Created 7 years ago
- Comments:34 (16 by maintainers)
Top Results From Across the Web
dotnet new project can't restore it's dependencies
To all the dependencies that i have in my project are getting the similar error like this: NU1002 The dependency System.Runtime.Handles 4.0.1 ...
Read more >dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >dotnet sdk 2.0.0 - cant restore a dependency - vs ui shows ...
I add a <PackageReference> to Dazinate.Dnn.Cli (version 0.5.0-unstable0007) nuget package which supports net452. In VS - if i expand the project dependencies ......
Read more >Dotnet restore clean. cs files) Removing information from ...
The dotnet restore command uses NuGet to restore dependencies and project-specific tools specified in the project file. First off we need a ....
Read more >Dotnet restore vs nuget restore. Share. In my code repo, there
I am trying to restore NuGet packages in my project using the CLI. ... So, it's much better to use dotnet restore, or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That looks pretty wrong…
@Petermarcu @shawnwildermuth I just got it to work, though I can’t say I definitely understand the cause. Here is my info and theory:
nuget.config
Broken (dotnet new generated)
Working:
In the project.lock.json all of the dependencies in the broken scenario are all referencing rc3. I suspect that something was recently pushed to a myget feed referencing rc3. Something about
dotnet restore
is potentially not respecting a version lock or something with the way the explicit version is written in project.json. By using the wildcard match, I believe I’m forcing it to respect rc2.