Visual Studio 2017 RC Core控制台项目无法编译。

4
当我创建一个新的enoty核心控制台项目时,它无法编译。
我发现nuget包没有被恢复。

enter image description here

当我运行dotnet restore时,我收到以下错误信息:

microsoft.net.sdk\1.0.0-alpha-20161104-2\build\Microsoft.NET.RuntimeIdentifierInference.targets(45,5): error : RuntimeIdentifier必须针对.NETFramework可执行文件进行设置。 考虑使用RuntimeIdentifier=win7-x86或RuntimeIdentifier=win7-x64。

请问我缺少了什么?

1
尝试编辑您的csproj文件,并在<PropertyGroup>元素内添加<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64</RuntimeIdentifiers> - annemartijn
1个回答

7

根据 @annemartijn 的建议,但没有 s

<RuntimeIdentifier>win7-x64</RuntimeI‌​dentifier>

查看Github上的问题: https://github.com/dotnet/cli/issues/4619

在您的 .csproj 文件中插入运行时标识符段:

<Project...
  <Import...
  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
    ...
    <RuntimeIdentifier>win7-x64</RuntimeI‌​dentifier>
  </PropertyGroup>
...

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接