3

i want to publish my web site using msbuild command line.my requirement is below mentod

  1. get the latest code from sever and stored in specified folder.this is done by folloing code

    <Target Name="GetSource">
    <Message Text="Checking out trunk into $(SourceDirectory)" />
    <SvnCheckout RepositoryPath="$(SvnCheckoutPath)"
        LocalPath="$(CheckOutPath)"
        UserName="aaa"
        Password="aa">
    
    
      <Output TaskParameter="Revision" PropertyName="Revision" />
    
    </SvnCheckout>
    <Message Text="Have got revision: $(Revision)"/>
         </Target>
    

    i have achived to get update code in specified folder.(1st reqirement is done)

2.build 3.publish to spcific path

so could you please tell me how to achieve 2 and 3 requirement.??

2

1 Answer 1

4

You could create a new target for "Publish" and from a command line, specify the target and include a parameter that contains the path where you'd want to publish the web site.

<Target Name="Publish">
<PropertyGroup>
  <PublishDirectory>$(PublishDirectory)</PublishDirectory>
</PropertyGroup>

<!-- publish logic using a copy files task or custom task goes here -->
</Target>

From a command line, invoke MSBUILD specifying the target to execute and the path to publish:

msbuild.exe /t:Publish /p:PublishDirectory="D:\InetPubExt\HomeApp\"

That should get you started :)

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

1 Comment

Would you please fill the publish logic part? In need your code as well.

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.