错误 MSB4018:Visual Studio 2017 年“VCMessage”任务意外失败
error MSB4018: The “VCMessage” task failed unexpectedly' in Visual Studio 2017
Visual Studio 2017 专业。
本机 C++ 项目。
在我更改了一些项目设置之后,项目构建以这个结束:
Microsoft.CppCommon.targets(770,5): error MSB4018: The "VCMessage" task failed unexpectedly.
Microsoft.CppCommon.targets(770,5): error MSB4018: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Microsoft.CppCommon.targets(770,5): error MSB4018: at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
...
提到的 PlatformToolSet 已设置。
怎么了?
这次是
Configuration Properties -> Linker -> Debugging -> Generate Program Database File
如果省略文件名(而邻居选项 "Generate Debug Info" 不是 "No"),则 VS-2017 完成构建并出现错误 MSB4018。尽管如此,在这种情况下还是建立了一个目标。
右键单击项目并转到“属性”>“链接器”>“常规”。
然后将"Output File"设置为"Inherit from parent or project defaults"
转到错误列表 window 并单击错误,您可能会获得更多信息。在我的例子中,它指向 Microsoft.CppCommon.targets 中的一行,这是一个 XML 元素。在 arguments 属性中,一个值是 %(Link.ProgramDatabaseFile) 未设置并导致问题。
Visual Studio 2017 专业。 本机 C++ 项目。 在我更改了一些项目设置之后,项目构建以这个结束:
Microsoft.CppCommon.targets(770,5): error MSB4018: The "VCMessage" task failed unexpectedly.
Microsoft.CppCommon.targets(770,5): error MSB4018: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Microsoft.CppCommon.targets(770,5): error MSB4018: at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
...
提到的 PlatformToolSet
怎么了?
这次是
Configuration Properties -> Linker -> Debugging -> Generate Program Database File
如果省略文件名(而邻居选项 "Generate Debug Info" 不是 "No"),则 VS-2017 完成构建并出现错误 MSB4018。尽管如此,在这种情况下还是建立了一个目标。
右键单击项目并转到“属性”>“链接器”>“常规”。 然后将"Output File"设置为"Inherit from parent or project defaults"
转到错误列表 window 并单击错误,您可能会获得更多信息。在我的例子中,它指向 Microsoft.CppCommon.targets 中的一行,这是一个 XML 元素。在 arguments 属性中,一个值是 %(Link.ProgramDatabaseFile) 未设置并导致问题。