General Development

Basic VS C# post build event question – calin

Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
Does anyone now how post build events work in VS C# 2005? I want to copy the dll/exe that gets built placed in two locations.

I did a google on it but I couldn't find anything specific to this particular question.

------------------
Nanostorm

Briant

Member

Posts: 742
From: Stony Plain, Alberta, Canada
Registered: 01-20-2001
I use the post build event in my projects to do what you are describing. I simply wrote a .bat file to do the copying, and then in post build event section I run that .bat file.

------------------
Brian

"OOP programmers have a lot of class"

Check out this webhost! Fantastic prices, features and support!

Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
Hey, thanks for suggestion.
I managed to get it working eventually with this code:

copy "$(TargetPath)" "D:\Documents and Settings\Desktop\TestFolder\"

------------------
Nanostorm

SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
You use the build events just like writing a DOS command. I use it for copying files or running command-line EXEs. For example, I added a build step to stamp a serial number on the EXE after it's done buidling. And like you found out, you can use the IDE macros for specifying things (like TargetPath, in your example).

And you can have build events at various points in the build.