views:

6899

answers:

7

I have project with a post build event:

copy $(ProjectDir)DbVerse\Lunaverse.DbVerse.*.exe  $(TargetDir)

I works fine every time on my machine. I have a new developer who always gets the "exited with code 1" error. I had her run the same command in at a DOS prompt, and it worked fine. What could be causing this? Is there any way to get to the real error?

We are both using Visual Studio 2008.

+5  A: 

Get process monitor from SysInternals set it up to watch for the Lunaverse.DbVerse (on the Path field) look at the operation result. It should be obvious from there what went wrong

Asher
+5  A: 

She had a space in one of the folder names in her path, and no quotes around it.

Tim Scott
putting quotes on path names is a good practice.not working in paths that contains space is event better :-)
Asher
A: 

As a matter of good practice I suggest you replace the post build event with a MS Build File Copy task.

Asher
+4  A: 

The one with the "Pings" helped me... but may be explained a little better...

For me the solution was to change:

copy $(TargetDir)$(TargetName).* $(SolutionDir)bin

to this:

copy "$(TargetDir)$(TargetName).*" "$(SolutionDir)bin"

Hope it works for you. :-)

JanBorup
+1  A: 

I ran across this post when troubleshooting a similar issue. My problem and solution was actually different from the others listed here so i'm adding it for the sake of completeness. The difference might be that I was calling a batch file but:

To avoid getting the dreaded exited with code 1 error I had to add the following line to the end of my batch file:

exit 0
Paul Sasik
A: 

Thnx! Its work! In my case:

mkdir "$(TargetDir)DB\"; mkdir "$(TargetDir)DB\Tables"; copy /Y "..\DB\Tables" "$(TargetDir)DB\Tables"; mkdir "$(TargetDir)DB\Static"; copy /Y "..\DB\Static" "$(TargetDir)DB\Static"; mkdir "$(TargetDir)DB\Update"; copy /Y "..\DB\Update" "$(TargetDir)DB\Update";

Sergey
A: 

If the target folder doesn't exist on the new developers machine, that can also cause problems.

Andrew