.net &引用;“dotnet还原”;以“失败”;找不到依赖项NETStandard.Library“;消息

.net &引用;“dotnet还原”;以“失败”;找不到依赖项NETStandard.Library“;消息,.net,coreclr,.net,Coreclr,我已经在MacOSX上安装了最新的.NETCore,并在 https://dotnet.github.io/getting-started/ 首先,我用“dotnetnew”创建了一个示例项目,然后运行命令“dotnetrestore”。它失败,并显示以下消息: Microsoft .NET Development Utility CoreClr-x64-1.0.0-rc1-16231 CACHE https://api.nuget.org/v3/index.json Restoring

我已经在MacOSX上安装了最新的.NETCore,并在

https://dotnet.github.io/getting-started/
首先,我用“dotnetnew”创建了一个示例项目,然后运行命令“dotnetrestore”。它失败,并显示以下消息:

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

  CACHE https://api.nuget.org/v3/index.json
Restoring packages for /Users/cookie/Documents/Github/t/project.json
  GET https://api.nuget.org/v3-flatcontainer/netstandard.library/index.json
  NotFound https://api.nuget.org/v3-flatcontainer/netstandard.library/index.json 2388ms
Unable to locate Dependency NETStandard.Library >= 1.0.0-rc2-23616
Writing lock file /Users/cookie/Documents/Github/t/project.lock.json
Restore complete, 2759ms elapsed

Errors in /Users/cookie/Documents/Github/t/project.json
    Unable to locate Dependency NETStandard.Library >= 1.0.0-rc2-23616

Feeds used:
    https://api.nuget.org/v3-flatcontainer/
我的电脑有404错误

https://api.nuget.org/v3-flatcontainer/netstandard.library/index.json
我在Windows上尝试了同样的方法,但也失败了。任何帮助都将不胜感激


编辑:这似乎是一个bug,在中讨论过。最新的安装包现在生成NuGet.config,并成功地从myget检索NETStandard.Library。

NETStandard.Library
尚未在NuGet上发布。加

<add key="DotNet-Core" value="https://myget.org/f/dotnet-core/api/v3/index.json" />


添加到您的
NuGet.config
文件中。

为Victor的答案添加更明确的信息,以防您的
NuGet.config
文件与我的类似。该文件有多个部分,需要将密钥添加到
中的
,以便您的文件最终看起来像这样:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
       <packageSources>
         <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/" />
         <add key="DotNet-Core" value="https://myget.org/f/dotnet-core/api/v3/index.json" />
      </packageSources>
     ...

...

谢谢您的回复。不幸的是,我找不到nuget.config文件,所以我认为最新的.NET核心包中存在问题。(我发现“dotnet new”只生成Program.cs/.json。)所以我再次尝试下载并安装.NET Core安装程序,这次“dotnet new”成功生成了NuGet.config。(里面有链接到myget的“dotnet core”密钥)。感谢您提供详细信息!正如我在Victor的回答中所写,我认为.NETCore安装程序包中存在问题。“dotnet new”仅生成两个文件(Program.cs/json),未生成NuGet.config。我再次下载并安装了这个包,这次它创建了nuget.config,正如您所描述的。谢谢