MSbuild Publish to a specific directory using batch file

12,133

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)

Share:
12,133
sam
Author by

sam

Updated on June 30, 2022

Comments

  • sam
    sam almost 2 years

    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?

  • sam
    sam almost 15 years
    It keep giving the follwoing error MSB1003: Specify a project or solution
  • Rich
    Rich almost 15 years
    Well, it is entirely correct. You apparently don't have a solution or project file in the current working directory so you need to specify one as an additional parameter.
  • sam
    sam almost 15 years
    It is building the project but says "Web projects do not support the Publish target. Continuing with the remaining projects....Any idea why it is not publishing to the specified directory