Post Build Events

D

David Battams

Hi there,

I'm calling xcopy in a post build event to copy some runtime requirements to
the TargetDir of the application I am working on. Problem is that I only
seem to be able to have 9 calls to xcopy. If I make any more calls than the
9, it will fail. I can call the same command 9 times, and the 10th will
fail, or I can call 10 different ones and it will fail on the tenth.
Basically it doesn't matter how I mix it up, but if I take a bunch of xcopy
commands that copy different files to the same location, no matter which
order and despite the fact each command works by itself or when 9 or less
commands are executed, if I go to 10 commands it fails. :-(

I tried to reproduce this in a new C++ app, copying "C:\test.txt" to the
TargetDir, but it seems I can call xcopy as many times as I like and it will
work in the test app.

What could be the problem in my application?

Regards,
David.
 
D

David Battams

Actually, I can reproduce this in a test app. Seems not to be related to the
number of lines, so I investigated the number of macros, and it also seems
not to be directly related. What it appears to be is a limitation on the
number of characters in the post build event? Seems to be the number of
characters post macro expansion.

For example, this will fail with a project at C:\...\Desktop\Test

xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y

But will work with the same project at C:\Test.

If I add more lines to the project in the shallower path, then it will also
fail...

Performing Post-Build Event...
'x..\..\..\..\test' is not recognized as an internal or external command,
operable program or batch file.

Is this a known issue?

Thanks,
David.
 
T

Tarek Madkour [MSFT]

From: "David Battams said:
Actually, I can reproduce this in a test app. Seems not to be related to the
number of lines, so I investigated the number of macros, and it also seems
not to be directly related. What it appears to be is a limitation on the
number of characters in the post build event? Seems to be the number of
characters post macro expansion.

...

Is this a known issue?

This is a bug in the 2003 version. We fixed it for our next release.

Thanks for the report.
 
D

David Battams

Thanks for the information! :)

"Tarek Madkour [MSFT]" said:
From: "David Battams" <[email protected]>

Actually, I can reproduce this in a test app. Seems not to be related to the
number of lines, so I investigated the number of macros, and it also seems
not to be directly related. What it appears to be is a limitation on the
number of characters in the post build event? Seems to be the number of
characters post macro expansion.

...

Is this a known issue?

This is a bug in the 2003 version. We fixed it for our next release.

Thanks for the report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top