visual-studio - 如何修复 Visual Studio 2010 中的错误 MSB4018?

标签 visual-studio

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.AppendFormat(IFormatProvider provider, String format, Object[] 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.LogWarningWithCodeFromResources(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(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets 990 6 vtk_minimal

最佳答案

我有同样的问题。我有一个旧的 Visual Studio 2005 C++ 项目,我用 Visual Studio 2010 C++ 重新打开了它。对我来说,第一个建议是在 Microsoft Connect工作:

The issue stems from the unexpected $(TargetDir) found in the property page under Link->OutputFile. During the build process, we tried to expand the OutputFile to a fullpath but only got an empty value. Thus, it led to the index out-of-bound exception.

It is unlikely we will be able to fix these before VS2010 release. The workaround is to correct OutputPath or inherit from parent.



右键单击该项目,然后转到“属性”>“链接器”>“常规”。然后将“输出文件”设置为“<从父级或项目默认值继承>”

希望也能帮您解决。

关于visual-studio - 如何修复 Visual Studio 2010 中的错误 MSB4018?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11985085/

相关文章:

ios - Visual Studio Xamarin - 使用 Web 服务构建发布 iOS 项目时出现问题

c# - 运行 Azure 函数时路径中存在非法字符

visual-studio - 为什么我无法在 Xamarin Forms 中选择 PCL 项目?

WPF 和 ToolboxItem(false)

visual-studio - 在 NuGet 中从 Entity Framework 6.2 升级到 6.3.0

c++ - 在具有不同版本的 visual studio 的静态库中内部使用 STL

visual-studio - 从向导取消 VS2010 项目创建

asp.net - 将 SVN 与 Visual Studio 2003 集成

visual-studio - 有没有一种方法可以设置一个批处理文件或脚本文件,我可以运行它来编译我的 .NET,这样我就可以单独在 Notepad++ 中进行编辑?

visual-studio - NuGet.exe 包提供对路径的访问被拒绝