none
VS 2012 build error

    Question

  • Hello there,

    I am trying to build zlib with visual studio 2012. I had a working vcproj from VS 2008 and just upgraded that to VS 2012. The vc90sp1 build works just fine but with vc110 I keep getting this error:

      C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018: The "CL" task failed unexpectedly. [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,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. [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at System.IO.Path.GetPathRoot(String path) [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at Microsoft.Build.Utilities.FileTracker..cctor() [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    --- End of inner exception stack trace --- [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at Microsoft.Build.CPPTasks.CL.ComputeOutOfDateSources() [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.SkipTaskExecution() [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at Microsoft.Build.Utilities.ToolTask.Execute() [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute() [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() [Y:\src\zlib\build\obj\win64\zlib\build\projects\visualc11\zlib.vcxproj]

    Any ideas on how to resolve this?

    Wednesday, April 6, 2016 6:11 PM

Answers

  • Hi tulip81,

    >> The type initializer for 'Microsoft.Build.Utilities.FileTracker' threw an exception. ---> System.ArgumentException: The path is not of a legal form.

    According to above error message you could know maybe this error is related to the path value.

    You could try to open that “zlib.vcxproj” file in an editor to see how simple/minimal it is. Try building that directly with MSBuild under your test environment. You could compare the updated “. vcxproj” file with the initial one to see whether there’re some differences. 

    As I searched, maybe it means your project probably wasn't built since the reference was added or that the project file has somehow been changed. You could try going over the references in the project and looking at where their locations are and verifying that they all actually exist.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 8, 2016 1:19 AM

All replies

  • Hi tulip81,

    >> The type initializer for 'Microsoft.Build.Utilities.FileTracker' threw an exception. ---> System.ArgumentException: The path is not of a legal form.

    According to above error message you could know maybe this error is related to the path value.

    You could try to open that “zlib.vcxproj” file in an editor to see how simple/minimal it is. Try building that directly with MSBuild under your test environment. You could compare the updated “. vcxproj” file with the initial one to see whether there’re some differences. 

    As I searched, maybe it means your project probably wasn't built since the reference was added or that the project file has somehow been changed. You could try going over the references in the project and looking at where their locations are and verifying that they all actually exist.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 8, 2016 1:19 AM
  • Hello Li Wang,

    Thank you for your reply and sorry it took me such a long time to get back. This issue took a back burner over some other things I was working on.

    So I tried everything that you suggested and no success. I am having the exact same issue when building libpng as well. I have a working vc90sp1 file, after upgrading to vc140 and even vc120, I get the same set of exceptions:

    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.

    I have no clue how to debug this and don;t even know which path it is talking about when it says 'path is not of a legal form'. There is very limited help online as well. Would appreciate if you can help me find the solution. I need this asap

    Friday, March 2, 2018 6:41 PM