错误路径不是合法格式

时间:2018-03-15 02:31:40

标签: python visual-studio-2015 msbuild open-source libpng

我正在尝试使用visual studio构建libpng。使用vc90sp1(Vs 2008)构建时,它没有任何问题。我使用visual studio将项目文件升级到vc140,现在当我使用msbuild构建时,它让我的路径不是合法形式的'错误。

我从Python脚本中调用msbuild并使用子进程。当我在命令行上直接运行msbuild时,它工作正常。不确定是什么问题,但我将所有必要的环境变量传递给我的子进程。同一段代码适用于我正在开发的另一个开源项目的vc140构建。这是错误:

09:17:00.233 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018: The "CL" task failed unexpectedly. [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018: System.TypeInitializationException: The type initializer for 'Microsoft.Build.Utilities.FileTracker' threw an exception. ---> System.ArgumentException: The path is not of a legal form. [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    at System.IO.Path.GetPathRoot(String path) [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    at Microsoft.Build.Utilities.FileTracker..cctor() [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    --- End of inner exception stack trace --- [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    at Microsoft.Build.CPPTasks.CL.ComputeOutOfDateSources() [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    at Microsoft.Build.Utilities.ToolTask.Execute() [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute() [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(253,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj]
09:17:00.234 MSBuild    INFO         Done Building Project "C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj" (default targets) -- FAILED.
09:17:00.235 MSBuild    INFO         Done Building Project "C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\libpng\libpng.vcxproj.metaproj" (default targets) -- FAILED.
09:17:00.268 MSBuild    INFO         Done Building Project "C:\libpng\build\obj\win64_vc140\libpng\build\projects\visualc140\vstudio.sln" (default targets) -- FAILED.

我不知道如何对此进行调试,甚至不知道它所说的路径是什么时候路径不是合法的形式&#39;。网上的帮助非常有限。

我最近也开了一个MSFT的错误,但无法得到解决方案:https://social.msdn.microsoft.com/Forums/vstudio/en-US/df065854-36e3-45da-9773-d8a6339b2745/msbuild-error-path-is-not-of-a-legal-form?forum=msbuild

0 个答案:

没有答案