If you want to work with solution, work with a solution file. Don't use "call" to run the application.
To give you the idea, I'll show you my usual batch file for .NET v.3.5:
::modify this path to use appropriate version of MSBuild:
set tool=%windir%\Microsoft.NET\Framework\v3.5\MSBuild.exe
set solution=MySolution.sln
%tool% %solution% /p:Configuration=Debug
%tool% %solution% /p:Configuration=Release
This batch will build the solution with the default
target with two different configurations. You can also use different targets, such as "clean". It's enough to look at the MSBuild.EXE command line documentation:
http://msdn.microsoft.com/en-us/library/ms164311.aspx[
^].
You would need to add the command parameter "/target", for example, "/target:Clean", or use more targets in one run: "/target:Clean;Build".
—SA