问题描述
亲爱的,
我通过编译cpp代码来获取此消息错误:
I obtain this message error by compiling a cpp code source:
Gravité 代码 说明 Projet ; Fichier Ligne Étatdela suppression
Erreur MSB4018 Échecinattendudelatâche"VCMessage"。$
System.FormatException:L'index(debasezéro )doitêtresupérieurouégalàzéroetinférieuràlataille de la liste des arguments。
àSystem.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider,String format,ParamsArray args)
àSystem.String.FormatHelper(IFormatProvider provider,String format,ParamsArray args)
àSystem.String.Format(IFormatProvider提供程序,字符串格式,对象[] args)
àMicrosoft.Build.Shared.ResourceUtilities.FormatString(String unformatted,Object [] args)
àMicrosoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted,Object [] args)
àMicrosoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName,Object [] args)
àMicrosoft.Build.Utilities.TaskLoggingHelper.LogWarningWithCodeFromResources(String messageResourceName,Object [] messageArgs)
àMicrosoft.Build.CPPTasks.VCMessage.Execute()
àMicrosoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
àMicrosoft.Build.BackEnd.TaskBuilder。< ExecuteInstantiatedTask> d__26.MoveNext() ConsoleApplication2 C:\Program Files(x86)\ Mesrosoft Visual Studio \\\ 2017 \ Communmunity \Common7 \IDE \ VC\VCTargets\Microsoft.CppBuild.targets 1216
Gravité Code Description Projet Fichier Ligne État de la suppression
Erreur MSB4018 Échec inattendu de la tâche "VCMessage".
System.FormatException: L'index (de base zéro) doit être supérieur ou égal à zéro et inférieur à la taille de la liste des arguments.
à System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
à System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
à System.String.Format(IFormatProvider provider, String format, Object[] args)
à Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
à Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
à Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
à Microsoft.Build.Utilities.TaskLoggingHelper.LogWarningWithCodeFromResources(String messageResourceName, Object[] messageArgs)
à Microsoft.Build.CPPTasks.VCMessage.Execute()
à Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
à Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() ConsoleApplication2 C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets 1216
有什么问题?
如何我可以解决这个问题吗?
How could I solve this problem?
非常感谢你的帮助,
Axel
推荐答案
欢迎来到MSDN论坛。
Welcome to the MSDN forum.
您是否从以前的MSVC迁移了这个项目版本到新的?和VS 2017一样?
Have you migrated this project from a previous MSVC version to new one? Like VS 2017?
请尝试为配置属性设置有效值 - >链接器 - >调试 - > "生成程序数据库文件"字段(例如
Please try to set a valid value for the Configuration Properties -> Linker -> Debugging -> "Generate Program Database File" field (e.g.
同时,一些成员提供了更多的解决方法可以参考,请参阅:
https://stackoverflow.com/questions/29121781/how- to-fix-error-msb4018-the-vcmessage-task-failed-unexpectedly-in-visual-s 。
Meanwhile, some members offered more workarounds could be reference, see: https://stackoverflow.com/questions/29121781/how-to-fix-error-msb4018-the-vcmessage-task-failed-unexpectedly-in-visual-s .
如果这打扰你,请告诉我们。
Please let us know if this unblocks you.
此致
可能
这篇关于错误MSB4018的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!