- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建一个新的 TFS 构建服务器,并决定使用 VS 2017 构建工具,而不是安装完整版本的 VS。当我尝试构建 C++ 项目时,它抛出以下错误:
Error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found.
经过几个小时的研究,我还没有更接近解决这个问题。我尝试添加以下注册表设置,但没有帮助。
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath14"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath14)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\11.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\14.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath14"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath14)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
我猜测该产品的 Microsoft 安装程序已损坏。是否有针对此错误的标准修复,或者我应该放弃我的努力并简单地安装完整版本?
在项目文件中,我找到了这个条目:
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
所以,我猜这意味着变量 VSTargetsPath 以某种方式指向 D: 驱动器的根目录,但我不知道在哪里设置该值。我们当前的构建服务器没有名为 VSTargetsPath 的环境变量集,但它确实缺少注册表项。它还安装了完整版本的 VS。
最佳答案
VS 2017 Build Tools failing with Error MSB4019: The imported project “D:\Microsoft.Cpp.Default.props” was not found
尝试将 VCTargetsPath
作为属性从构建配置显式传递给 msbuild:
编辑构建的构建定义。
单击“进程”选项卡。
在“高级”部分中,设置 MSBuild 参数以包含以下属性:
/p:VCTargetsPath="C:\Program Files (x86)\Microsoft Visual Studio\2017\xxx\Common7\IDE\VC\VCTargets\"
保存构建定义。
注意:您应该将 VCTargetsPath
的值更改为 VCTargets
文件夹的位置。
或者将 VisualStudioVersion
作为属性传递给 msbuild:/p:VisualStudioVersion=15.0
如果您对 $(VCTargetsPath)
的值感兴趣,您可以查看以下线程以获取更多详细信息:
Can't find registry entries for Visual Studio 2017
Over the years Visual Studio could be discovered using registry keys,but with recent changes to the deployment and extensibility models anew method is needed to discover possibly more than once installedinstance. These changes facilitate a smaller, faster default installcomplimented by on-demand install of other workloads and components.
vswhere is designed to be a redistributable, single-file executablethat can be used in build or deployment scripts to find where VisualStudio - or other products in the Visual Studio family - is located.For example, if you know the relative path to MSBuild, you can findthe root of the Visual Studio install and combine the paths to findwhat you need.
You can emit different formats for information based on what yourscripts can consume, including plain text, JSON, and XML. Pullrequests may be accepted for other common formats as well.
vswhere is included with the installer as of Visual Studio 2017version 15.2 and later, and can be found at the following location:%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe.
关于c++ - VS 2017 构建工具失败,错误 MSB4019 : The imported project "D:\Microsoft.Cpp.Default.props" was not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50497421/
我刚刚通过更改 import * as CodeMirror 修复了一个错误简单明了import CodeMirror . 我复制了this code . (从 TypeScript 移植) impo
我调试(在 PyCharm 中)一个脚本。我在断点处停止,然后转到调试控制台窗口,然后从那里调用导入行,如下所示: import my_util1 from my_utils 然后我调用 my_uti
谁能给我解释一下 import 语句是如何工作的? 例如,我在 myapp/app/models 包中有一个类型 User: package models type User struct {
我想导入 Control.App进入一个引用 PrimIO.PrimIO 的模块通过不合格的名称 PrimIO在很多地方。当然,问题在于 Control.App还导出一个名为 PrimIO 的定义.我
我应该使用 from foo import bar 或者 import foo.bar as bar 当导入模块 还有无需/希望更改名称 (bar)? 有什么不同吗?有关系吗? 最佳答案 假设 bar
我正在 Windows 上使用 Theano 进行深度学习实验的第一步,我很惊讶仅仅加载库需要多少时间。 这是小测试程序: from time import time t0 = time() impo
在 TypeScript 中,如何在不创建任何别名的情况下从文件“导入 *”? 例如我有一个包含顶级导出函数的文件“utils”,我想导入所有这些函数而不为每个函数重新创建别名。 像这样: impor
我应该使用 from foo import bar 或 import foo.bar as bar 当导入模块并且不需要/希望更改名称(bar)? 有什么不同吗?有关系吗? 最佳答案 假设bar是fo
这个问题在这里已经有了答案: Use 'import module' or 'from module import'? (23 个回答) 关闭8年前。 我想知道代码片段之间是否有任何区别 from u
我试过了 from urllib import request mine = request.Request() 和 import urllib.request mine = urllib.reque
所以,我有一个关于 Python 导入的小谜团。我确信出于某种原因事情应该是这样的,因为 Guido 很少出错。但是,为什么会这样呢? $ cat myModule.py #!/usr/bin/pyt
我们正在将 Rails 3.2 应用程序升级到 Rails 4.0。 我们有一个 assets/stylesheets/application/index.css.sass加载一些其他 sass 文件
我正在开发一个相当小的 Typescript 代码库,该代码库已经足够大,可以拆分到多个文件中。这是一个二十一点游戏。我目前有一堆代码,看起来像: var player = new Player();
是否可以以当模块为 use 时的方式编写模块? d 没有显式导入所有子例程都被导入,当它是 use d 显式导入只有这些显式导入的子程序可用? #!/usr/bin/env perl6 use v6;
这个问题在这里已经有了答案: how to watch changes in whole directory/folder containing many sass files (9 个回答) 5年前
我真的很难让它在 xcode 4 中工作。 我有一个项目将在许多应用程序(网络)中重用,因此我创建一个工作区并添加我的两个项目。到目前为止,一切都很好....这就是失败的地方.. #import "J
经典提取器和新提取器之间的主要区别是什么,哪个最好用? 最佳答案 经典提取器使用原始工作流程,与爬虫和连接器相同。 新的提取器更加精简,通常看起来和感觉都更好,并且经典提取器中的许多小错误已在新提取器
在处理 google webfont import mixin 时,我注意到无法动态构建 @import URL。 .gFontImport (@name, @weights, @subsets) {
我正在关注Django 1.8 tutorial 。在我的项目中mysite ,有一个源文件夹polls 。文件夹中有views.py模块其中 index函数已定义。还有一个urls.py文件: fr
我想使用名为 warp 的第三方库编译一个简单的 Rust 程序: [package] name = "hello-world-warp" version = "0.1.0" [dependencie
我是一名优秀的程序员,十分优秀!