dotnet new install fails due to NuGet.targets
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
Do you have the folder above? Is it empty?
{version}/scratch/restore.csprojdoes not exist
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?
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
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.
the correct path should be ~/.nuget/NuGet/NuGet.config... but yes that did work
Sorry, I didn't realize you were not on Windows. Closing the issue. Re-activate if something else comes up.
遇到同样的问题,删除之前安装的.nuget目录即可: rm -rf ~/.nuget 然后再 dotnet restore