升级到 .Net Standard 2,现在项目说参考不存在

Upgraded to .Net Standard 2, now project says reference isnt there

我刚刚将 .Net Standard 1.4 PCL dll 升级到 .Net Standard 2.0。我正在尝试编写一个 returns 一个 ValueTuple 的方法,但出现错误:

Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference?

但它是......有点。以下是我的 project.json 所说的:

{
  "supports": {},
  "dependencies": {
    "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
    "NETStandard.Library": "2.0.0",
    "Newtonsoft.Json": "10.0.3",
    "System.Collections.Specialized": "4.3.0",
    "System.ComponentModel.Annotations": "4.4.0",
    "System.Net.Http": "4.3.2",
    "System.Reflection": "4.3.0",
    "System.Runtime.Serialization.Primitives": "4.3.0",
    "System.ServiceModel.Primitives": "4.4.0",
    "System.ValueTuple": "4.4.0"
  },
  "frameworks": {
    "netstandard2.0": {}
  }
}

但是当我扩展项目的参考时,我注意到有几个包没有列出。

我试过这个 但没有成功。

编辑:我使用的是 VS 2017

我也遇到了这个问题。原来我的 .csproj 文件有下面几行,即使引用的版本是 .NET Core 2.0。我删除了这些行并成功构建了项目。

<RuntimeFrameworkVersion>1.1.2</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>

我无法绕过这个 SNAFU,所以我最终只是创建了一个基于 .net 标准 2.0 的全新项目。将我的所有文件复制到新项目并将其添加为对我所有项目的引用。它破坏了我的 resharper,但其他一切正常。