Search code examples
asp.netvisual-studio-2010msbuildpublish

How to publish an Asp.Net MVC 2 application using commandline?


In Visual Studio 2010 we can right click a Web application and select Publish from the Menu. Using this we can publish a web application to a File System.

How can we achieve the same using Command line?

EDIT: Although we can use xcopy as suggested it is not same as Publish command as we have to manually exclude unnecessary files.


Solution

  • You're looking for Aspnet_compiler.exe to publish using the command line.

    If using MSBuild then you need the AspNetCompiler Task.

    The options the Aspnet_compiler provides are the same as those provided by Visual Studio's Publish option.