简体   繁体   English

找不到Microsoft.NETCore.Native.targets

[英]Microsoft.NETCore.Native.targets was not found

I'm trying to " Compiling source to native code using the ILCompiler ". 我正在尝试“ 使用ILCompiler将源代码编译为本地代码 ”。

I did: 我做了:

  1. dotnet new console dotnet新控制台
  2. dotnet build 网络构建
  3. 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" /> 

    1. set IlcPath=C:\\Users\\Documents\\Visual Studio 2017\\Projects\\testproject\\bin\\Debug\\netcoreapp1.0
    2. dotnet build 网络构建
 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.

相关问题 找到框架“Microsoft.NETCore.App”,版本“5”时找不到 Microsoft.NETCore.App 5.0.0 - The framework 'Microsoft.NETCore.App', version '5' was not found while Microsoft.NETCore.App 5.0.0 is found 找不到Travis-CI&#39;Microsoft.NETCore.App&#39;,版本&#39;1.1.2&#39; - Travis-CI 'Microsoft.NETCore.App', version '1.1.2' was not found 找不到框架“Microsoft.NETCore.App”,版本“5.0.13” - The framework 'Microsoft.NETCore.App', version '5.0.13' was not found 找不到指定的框架“Microsoft.NETCore.App”,版本“2.2.0” - The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found 如何修复“Microsoft.NETCore.App”,找不到版本“1.1.2”? - How to fix 'Microsoft.NETCore.App', version '1.1.2' was not found? 未找到 Microsoft.NetCore.App 或 Microsoft.AspNetCore.App 的指定版本 - The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found 找不到任何兼容的框架版本。 找不到指定的框架“Microsoft.NETCore.App”,版本“2.2.0” - It was not possible to find any compatible framework version. The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found 未找到 Linux NSwag NPM CLI 框架 Microsoft.NETCore.App 版本 2.1.0 - Linux NSwag NPM CLI-framework Microsoft.NETCore.App version 2.1.0 was not found nuget restore 启动 dotnetcore SDK 3.1.420 时未找到 Microsoft.NETCore.App.Host.win-x64 - Microsoft.NETCore.App.Host.win-x64 not found while nuget restore starting dotnetcore SDK 3.1.420 分发应用程序时,我找不到microsoft.netcore.platforms文件。 这个怎么运作? - when distribute app, i can't found the file of microsoft.netcore.platforms. how it works?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM