Faruz
Faruz

Reputation: 9959

.net command-line compiler multiple projects

I need to build a batch file that runs on a directory and digs inside for suitable c# projects to compile. (and compile them of course).

I don't know the name of the projects inside the directory.

I can assume all project are in c# and written in VS2008 and above (if that helps).

Upvotes: 1

Views: 124

Answers (1)

KeithS
KeithS

Reputation: 71565

setlocal
SET CMD= msbuild.exe 

for /R %%d in (*.csproj) do %CMD% %%d
endlocal

This will build each project into individual assemblies, with all default build properties for each project. You can specify additional properties, or an MSBuild config file to use.

Upvotes: 3

Related Questions