基本bproject create无法创建Nuget缓存的填充

时间:2016-09-11 12:49:36

标签: asp.net-core asp.net-core-mvc

我正在努力让我的第一个.Net Core解决方案正常运行。

当我尝试在VS 2015中创建项目时,它失败了。所以回归基础。

使用以下指示: MS .Net Core

我做到了。

C:\dev\Tests>mkdir hwapp2
C:\dev\Tests>cd hwapp2
C:\dev\Tests\hwapp2>dotnet -v new


Welcome to .NET Core!
---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
Telemetry
--------------
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
Configuring...
-------------------
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
Decompressing 100% 1758 ms
Expanding 100% 6072 ms
Failed to create prime the NuGet cache. restore failed with: 1
Telemetry is: Disabled
Created new C# project in C:\dev\Tests\hwapp2.

我在管理员命令提示符下运行此命令。当我尝试在VS 2015中创建一个项目时也会发生同样的事情。顺便说一句,关闭了防火墙。

环境

  • Windows 10 Pro(Build 14393)
  • VS 2015 with Update 3(Enterprise)
  • Dot Net Core Preview 2.0.1(截至2016年9月10日的最新下载)

4 个答案:

答案 0 :(得分:1)

您应该安装最新的.NET Core SDK并删除所有以前安装的版本。

答案 1 :(得分:0)

尝试清除this post中的nuget缓存。这对我有帮助。

简而言之,您需要从here下载nuget命令行工具。

然后运行命令: nuget locals all -clear

答案 2 :(得分:0)

这是known issue

我必须执行以下步骤来解决此问题:

  • 卸载Microsoft .Net Core SDK 2.0 Preview 1
  • 卸载Microsoft .Net Core SDK 2.0 Preview 2

这使我能够执行命令" dotnet run"没有上面的错误。

运行" dotnet run"一旦我重新安装Microsoft .Net Core SDK 2.0预览版2,错误就不再出现了(根据this post应该会发生什么)

答案 3 :(得分:0)

issue on GitHub描述了安装了dotnet-core 2.0.0 但在global.json中定义 SDK 1.0.4 的情况。以下环境变量是一种解决方法:

DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1