0

What are the differences between msbuild /t:publish and msbuild/t:package when preparing a web app for deployment?

I know both of them prepare the application for deployment by gathering all necessary files and dumping them in a directory and package does this plus zips the files up. Are these the only differences? Are there any differences in how the files are prepared for deployment?

Do these function the same as "Publish" and "Build deployment package" in Visual studio 2010?

Thanks

1 Answer 1

1

The package switch will create a deployable package that you can manually copy to your server and run, whereas publish will attempt to upload the package to your web server and execute it automatically.

With package, you will find a number of files in

[ProjectDir]\obj[BuildType]\Package

You need to copy across the .cmd, .SetParameters.xml, and the .zip files if you want to manually run it on the target server. You'll need to run the .cmd as Administrator.

2
  • Are the files generated by the two the same? If I do a publish to my local file system and copy the files over to the web server, will this give me the same results as creating a package and importing the package to IIS or extracting the package to the web directory?
    – Chris
    Jun 6, 2012 at 20:36
  • I believe so. I never succeeded in getting publish to work in my environment, but it should be the exact same result.
    – Eric J.
    Jun 6, 2012 at 20:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.