2

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?

1 Answer 1

2

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)

Sign up to request clarification or add additional context in comments.

3 Comments

It keep giving the follwoing error MSB1003: Specify a project or solution
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.
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.