VS报错 Error MSB4018 The “VCMessage“ task failed unexpectedly. System.
测试VS程序,报错:
Severity Code Description Project File Line Suppression State
Error MSB4018 The "VCMessage" task failed unexpectedly.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
at Microsoft.Build.Utilities.TaskLoggingHelper.LogErrorWithCodeFromResources(String messageResourceName, Object[] messageArgs)
at Microsoft.Build.CPPTasks.VCMessage.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() FeimosRaster C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets 57
这是因为没有平台工具集。解决方案:
点击属性。然后:
选择你的平台。这样就可以了。
解决方案来自贴吧某位大佬:
链接:https://tieba.baidu.com/p/1324025521?red_tag=0312166438