.net core 2.0 报错:error NU1102: Unable to find package 。。。

这种是nuget无法还原的问题。解决问题的方法:

在项目文件所在的目录下创建文件:NuGet.Config

里面内容:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <!--To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

然后再项目文件所在目录下进入cmd,输入:

dotnet restore

问题解决。

原文地址:https://www.cnblogs.com/a14907/p/7194222.html