2017-05-19 9 views
0

Ich versuche, "Compiling source to native code using the ILCompiler".Microsoft.NETCore.Native.targets wurde nicht gefunden

ich getan habe:

  1. Dotnet neue Konsole
  2. Dotnet build
  3. Changed die csproj zu

    <PropertyGroup> 
        <OutputType>Exe</OutputType> 
        <TargetFramework>netcoreapp1.0</TargetFramework> 
    </PropertyGroup> 
    
    <Import Project="$(MSBuildSDKsPath)\Microsoft.NET.Sdk\Sdk\Sdk.targets" /> 
    <Import Project="$(IlcPath)\Microsoft.NETCore.Native.targets" /> 
    

    1. set IlcPath=C:\Users\Documents\Visual Studio 2017\Projects\testproject\bin\Debug\netcoreapp1.0
    2. Dotnet bauen
Microsoft (R) Build Engine version 15.3.117.23532 
Copyright (C) Microsoft Corporation. All rights reserved. 

C:\Users\Documents\Visual Studio 2017\Projects\testproject\testproject.csproj(9,3): error MSB4019: The imported project "C:\Users\Documents\Visual Studio 2017\Projects\testproject\bin\Debug\netcoreapp1.0\Microsoft.NETCore.Native.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. 

Build FAILED. 

C:\Users\Documents\Visual Studio 2017\Projects\testproject\testproject.csproj(9,3): error MSB4019: The imported project "C:\Users\Documents\Visual Studio 2017\Projects\testproject\bin\Debug\netcoreapp1.0\Microsoft.NETCore.Native.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. 
    0 Warning(s) 
    1 Error(s) 

Time Elapsed 00:00:00.17 

verwendete ich die x64 NAtive Tools-Eingabeaufforderung für VS 2017

Mein Setup:

Dotnet --info .NET Befehlszeilen-Tools (2.0.0-preview2-006080)

Produktinformation: Version: 2.0.0-preview2-006080 Commit SHA-1-Hash: 0a89053574

Runtime Environment: O Name: Windows-OS Version: 10.0.15063 OS Plattform: Windows RID: win10-x64 Basispfad: C: \ Program Files \ dotnet \ sdk \ 2.0.0-preview2-006080 \

Microsoft .NET-Core Freigegebener Framework-Host

Version: 2.0.0-preview2-25309-07 Build : 41f5fc94eedc889f086800c23f35bf14a8c75a9f

Was zu dieser Microsoft.NETCore.Native.targets? Es scheint eine Art spezieller Platzhalter zu sein. Wie kann ich den obigen Fehler beheben?

+0

Verwenden Sie die Vorschauversion von VS 2017? –

+0

Nein. Visual Studio Enterprise 2017 15.2 (26430.6) – Briefkasten

+0

Ich denke, dass Sie die Vorschau-Version für .NET Core 2.0 richtig funktionieren müssen https://www.microsoft.com/net/core/preview#windowscmd –

Antwort

0

IlcPath bedeutet, auf die Ausgabe eines Builds von CoreRT (C:\path_to_your\corert\bin\Product\Windows_NT.x64.Debug\packaging\publish1) gesetzt werden und nicht Ihre eigene App. Sie müssen CoreRT klonen und erstellen, damit dies funktioniert.

Verwandte Themen