Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying following but it not rebuild the project. I want to clean solution and rebuild it using batch file. If any one have idea please share.

VB
rd .\BuildResults /S /Q
md .\BuildResults

setlocal enableextensions
set name=%DATE:/=_%
mkdir C:\BuildProject\bash\%name%\DialerRegistration

REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v3.5
set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319
call %msBuildDir%\msbuild.exe  E:/DialerTFS/PredictiveDialer/DialerRegistration/DialerRegistration/DialerRegistration.csproj /p:Configuration=Debug /l:FileLogger,Microsoft.Build.Engine;logfile=C:\BuildProject\bash\%name%\DialerRegistration/Compile_Log.log
Posted

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900