[英]Microsoft.NETCore.Native.targets was not found
I'm trying to " Compiling source to native code using the ILCompiler ". 我正在尝试“ 使用ILCompiler将源代码编译为本地代码 ”。
I did: 我做了:
Changed the csproj to 将csproj更改为
<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" />
set IlcPath=C:\\Users\\Documents\\Visual Studio 2017\\Projects\\testproject\\bin\\Debug\\netcoreapp1.0
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
I used the x64 NAtive Tools Command PRompt for VS 2017 我为VS 2017使用了x64 NAtive Tools Command PRompt
My Setup: 我的设置:
dotnet --info .NET Command Line Tools (2.0.0-preview2-006080)
dotnet --info .NET命令行工具(2.0.0-preview2-006080)
Product Information: Version: 2.0.0-preview2-006080 Commit SHA-1 hash: 0a89053574
产品信息:版本:2.0.0-preview2-006080提交SHA-1哈希:0a89053574
Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\\Program Files\\dotnet\\sdk\\2.0.0-preview2-006080\\
运行时环境:OS名称:Windows OS版本:10.0.15063 OS平台:Windows RID:win10-x64基本路径:C:\\ Program Files \\ dotnet \\ sdk \\ 2.0.0-preview2-006080 \\
Microsoft .NET Core Shared Framework Host
Microsoft .NET Core共享框架主机
Version : 2.0.0-preview2-25309-07 Build : 41f5fc94eedc889f086800c23f35bf14a8c75a9f
版本:2.0.0-preview2-25309-07内部版本:41f5fc94eedc889f086800c23f35bf14a8c75a9f
Whats about this Microsoft.NETCore.Native.targets? 关于此Microsoft.NETCore.Native.targets呢? It seems to be a kind of a special placeholder.
它似乎是一种特殊的占位符。 How can I fix the above error?
如何解决以上错误?
IlcPath
is mean to be set to the output of a build of CoreRT ( C:\\path_to_your\\corert\\bin\\Product\\Windows_NT.x64.Debug\\packaging\\publish1
) and not your own app. IlcPath
设置为CoreRT构建的输出( C:\\path_to_your\\corert\\bin\\Product\\Windows_NT.x64.Debug\\packaging\\publish1
),而不是您自己的应用程序。 You'll need to clone and build CoreRT for this to work. 您需要克隆并构建CoreRT才能正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.