Tutorial :MSbuild Publish to a specific directory using batch file



Question:

Following is the batch file for doing a publish to a publish directory

@echo off  start      /b      C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe      /target:publish      /p:SolutionDir="C:\cc\ttr\code\Com.IT.sln"      /p:PublishDir="C:\cc\ttr\code\deploy\"      /p:Configuration=Debug              

(wrapped for easier reading)

It is not publishing it. Any idea why?


Solution:1

When start gets multiple arguments the first one is the title for the new window. Try

start /B "" start /b C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe ^  /target:publish ^  /p:SolutionDir="C:\cc\ttr\code\Com.IT.sln" ^  /p:PublishDir="C:\cc\ttr\code\deploy\" ^  /p:Configuration=Debug  

(should work with the ^ at the end of the lines, for readability, but if not just put it all into one line again)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »