错误MSB4019:导入的项目“C:\ Microsoft.Cpp.Default.props”没找到。确认< I mport>中的路径声明是正确的,并且该文件存在于磁盘上。

错误MSB4019:导入的项目“C:\ Microsoft.Cpp.Default.props”没找到。确认< I mport>中的路径声明是正确的,并且该文件存在于磁盘上。

问题描述:

我运行程序时遇到此问题。我的计算机上有msbuild文件夹。 VS版本是2015.任何人都可以帮忙吗?

i have this problem when i run my program. i have the msbuild folder in my computer. The VS version is 2015.anyone can help?

谢谢和最好的问候

你好chenxiaozhen,

Hi chenxiaozhen,

感谢您在这里发帖。

是否已创建此项目通过其他版本的VS,然后使用Visual Studio构建它?

编辑项目文件时,您将找到以下信息:

When you edit your project file, you will find below info:

Import Project="


(VCTargetsPath)\ MyCrosoft.Cpp.Default.props" />
(VCTargetsPath)\Microsoft.Cpp.Default.props" />

根据错误日志,似乎MSBuild无法在寄存器中获取VCTargetsPath的值。路径为C:\Program Files(x86)\ MSBuild\Microsoft.Cpp \v4.0 \ V140,寄存器中的值为:

According to the error log, it seems that MSBuild can not get the value of VCTargetsPath in register. The path is C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140 and the value in register is:

HKEY_LOCAL_MACHINE \ SOFTWARE \ (Wow6432Node )\ Microsoft /\\ MSBuild \ToolsVersions \ 4.0 \ VCTargetsPath。默认值为"

HKEY_LOCAL_MACHINE\SOFTWARE\(Wow6432Node)\Microsoft\MSBuild\ToolsVersions\4.0\VCTargetsPath. The Default value is "


([MSBuild] :: ValueOrDefault('
([MSBuild]::ValueOrDefault('