Redouane
Redouane

Reputation: 430

"dotnet restore" command fails with Restore failed Response is not a valid NuGet v2 service response

I am trying to instal .NET core on Ubuntu 14.04 following the steps shown in this link http://dotnet.github.io/getting-started/ But i cannot pass the 4th step: "dotnet restore", it displays the following error in terminal:

Error: FindPackagesById: System.Console
  Response from https://api.nuget.org/v3/index.jsonFindPackagesById()?id='System.Console' is not a valid NuGet v2 service response.

and other warnings like this:

Warning: FindPackagesById: System.Console
  Response from https://api.nuget.org/v3/index.jsonFindPackagesById()?id='System.Console' is not a valid NuGet v2 service response.

I don't understand the reason of this failure. all previous steps worked normally. help me please! :)

Upvotes: 2

Views: 1257

Answers (1)

Redouane
Redouane

Reputation: 430

Well, i have fixed this by executing the following commands:

$ dnu clear-http-cache

And after executing:

$ dnu list

And then i found out that i have unresloved references, terminal showed this:

Microsoft .NET Development Utility Mono-x64-1.0.0-rc1-16231

Listing dependencies for devnet (/home/red/Desktop/devnet/project.json)

[Target framework DNXCore,Version=v5.0 (dnxcore50)]

Unresolved references:
* Microsoft.NETCore.Runtime 1.0.1-beta - Unresolved
* System.Console 4.0.0-beta - Unresolved
* System.IO 4.0.11-beta - Unresolved
* System.Runtime 4.0.21-beta - Unresolved

After i run this command:

    $ dnu install Microsoft.NETCore.Runtime 1.0.1-beta Microsoft .NET Development Utility Mono-x64-1.0.0-rc1-16231

after this i have got a successful restore

Restore complete, 6771ms elapsed

Note: if you have access permession problem when executing $ dnu install you have to change permission of /.dnu directory with chmod

:)

Upvotes: 2

Related Questions