2016-11-28 173 views
4

当我创建一个新的enoty核心控制台项目不编译的Visual Studio 2017年RC Core控制台项目不编译

我可以看到的NuGet包没有恢复。

enter image description here

当我运行dotnet restore我得到的错误

microsoft.net.sdk \ 1.0.0-α-20161104-2 \建造\ Microsoft.NET.RuntimeIdentifierInference.targets(45 ,5): 错误:必须为.NETFramework可执行文件设置RuntimeIdentifier。 请考虑RuntimeIdentifier = win7-x86或RuntimeIdentifier = win7-x64。

我在想什么?

+1

尝试编辑你的csproj并添加' 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'在你的''元素中 – annemartijn

回答

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> 
... 
相关问题