how can I execute a batch file during build time ?

C

carrot

With .Net Studio,

I have a solution includes some projects.
I want to execute a batch file during build solution time.
For example,
1'st project is builded.
2'nd project is builded.
" a batch file is executed."
3'rd project is builded.

how can I do this?
how can I include a batch file in the solution?
how can I determine the order in projects and a batch file?

(the projects were written by C# and C++)
 
C

Champika Nirosh

Hi Carrot,

I don't think that IDE will support this, I guess you have to use a batch
file itself for compiling the projects as well..

Just try it that way and see

Nirosh.
 
C

Champika Nirosh

Hi Carrot,

I don't think that IDE will support this, I guess you have to use a batch
file itself for compiling the projects as well..

Just try it that way and see

Nirosh.
 
C

Champika Nirosh

Hi Carrot,

I don't think that IDE will support this, I guess you have to use a batch
file itself for compiling the projects as well..

Just try it that way and see

Nirosh.
 
S

Sami Vaaraniemi

Take a look at the properties of the project. In the Property Pages dialog,
under Common Properties/Build Events there are two properties of interest:
Pre-build Event Command Line and Post-build Event Command Line.

You can put the path and name of your batch file into the Post-build Event
of 2nd project, or Pre-build Event of the 3rd project. This will execute the
batch file between the builds of 2nd and 3rd projects.

The caveat is that managed web projects do not have build events.

If the 2nd and 3rd projects are web projects, then you can hack around the
problem by creating a dummy project. Create a dependency from the 3rd
project to the dummy project, and from the dummy project to the 2nd project.
This ensures that VS.NET builds the dummy project in between the 2nd and 3rd
projects. Then have the Pre-build or Post-build event of the dummy project
call your batch file.

hth,
Sami
 

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