MSBuild MSB6003 Work Around

One of the QC items not fixed in the XE6 release is 98008, probably because it is still in the Reported state even though it was submitted August 23, 2011. I have previously blogged about the state of QC, so I won’t get into that issue again, suffice to say I hope the QPS initiative continues, and QC incidents get reviewed.

I have been encountering the same error as QC98008 because between DevX, TeeChart, and TMS the search paths for units (stored in OPTSETS) has exceeded the 32,000 character limit primarily because the same paths are used multiple times by MSBuild when constructing the build command.  It was included in the ResourcePath, IncludePath, UnitSearchPath and ObjectPath.  Since no OBJ files were in use, and resources are included in the project files, we simply changed the CodeGear.Delphi.Targets file located in the Delphi Bin folder, setting both the ResourcePath and ObjPath to an empty string (lines 192 & 194) as follows:

ResourcePath=""
IncludePath="$(IncludePath)"
ObjPath=""

This resolved the duplicate path issue that resulted in the exceedance of the 32000 character limit.

2 Responses to “MSBuild MSB6003 Work Around”

  1. Jeroen Wiert Pluimers Says:

    Did you report this issue with Microsoft? As ultimately they are the ones that should fix it (including issues with paths longer than 260 characters).

    Delphi users are not the only ones bumping into this kind of stuff:

    http://blogs.msdn.com/b/aaronhallberg/archive/2007/06/20/team-build-and-260-character-paths.aspx

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/7bacb6d0-08ad-4eb6-9db2-a60c700fbf95/vcbuild-compilation-problem

  2. Larry Hengen Says:

    @Jeroen,

    No I have no reported it to M$. While the path limitation is certainly an issue, I think the unnecessary (IMHO) duplication of the paths (an EMBT issue) is more significant. Besides, if I worried about every bug I found, I would spend my whole day just reporting them and providing test cases ;-) Maybe I should switch from DEV to QA…

Leave a Reply