sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dotnet new install fails due to NuGet.targets

Open dansiegel opened this issue 9 years ago • 8 comments

Steps to reproduce

dotnet new -i "Prism.Forms.QuickstartTemplates::*"

or any other template

Expected behavior

a specified template is installed via NuGet

Actual behavior

Dans-MacBook-Air:~ dansiegel$ dotnet new -i "Prism.Forms.QuickstartTemplates::*"
  Restoring packages for /Users/dansiegel/.templateengine/dotnetcli/v2.0.0-preview3-006770/scratch/restore.csproj...
/usr/local/share/dotnet/sdk/2.0.0-preview3-006770/NuGet.targets(102,5): error : Failed to retrieve information about 'Prism.Forms.QuickstartTemplates' from remote source '/Users/dansiegel/.dotnet/NuGetFallbackFolder'. [/Users/dansiegel/.templateengine/dotnetcli/v2.0.0-preview3-006770/scratch/restore.csproj]

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0-preview3-006770)

Product Information:
 Version:            2.0.0-preview3-006770
 Commit SHA-1 hash:  78e7163819

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.0-preview3-006770/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview3-25514-02
  Build    : 1b047a04057cec973cfb890fd21f7a639cfcd118

dansiegel avatar Jul 14 '17 23:07 dansiegel

Do you have the folder above? Is it empty?

livarcocc avatar Jul 16 '17 18:07 livarcocc

{version}/scratch/restore.csprojdoes not exist

dansiegel avatar Jul 16 '17 19:07 dansiegel

Sorry, I meant does this folder exist /Users/dansiegel/.dotnet/NuGetFallbackFolder? and do you have anything on it? Did you, by any chance clean that folder yourself?

Also, can you edit the file under %appdata%/NuGet/NuGet.Config and remove all references to the folder above?

I believe the file you mention does not exist is a temporary file, that's why its path is pointing to a scratch folder.

Lastly, does restoring a regular project work?

livarcocc avatar Jul 18 '17 17:07 livarcocc

I had deleted /Users/dansiegel/.dotnet, /Users/dansiegel/.templateengine, /usr/local/share/dotnet, /etc/paths.d before running the installer. The folder you're asking about wasn't recreated

dansiegel avatar Jul 18 '17 17:07 dansiegel

It won't. Can you edit the NuGet.Config file that I mention above? This should fix things for you. In the latest CLI, we stopped producing that folder and/or modifying NuGet.Config files.

livarcocc avatar Jul 18 '17 20:07 livarcocc

the correct path should be ~/.nuget/NuGet/NuGet.config... but yes that did work

dansiegel avatar Jul 20 '17 03:07 dansiegel

Sorry, I didn't realize you were not on Windows. Closing the issue. Re-activate if something else comes up.

livarcocc avatar Jul 20 '17 04:07 livarcocc

遇到同样的问题,删除之前安装的.nuget目录即可: rm -rf ~/.nuget 然后再 dotnet restore

xumingxiang avatar Sep 17 '17 10:09 xumingxiang