I think the question title pretty much said it all, but for clarity, I am trying to:
- Build a VS2010 ASP.NET MVC4 solution from the command line (MSBuild), specifying a solution configuration (e.g. Release)
- Apply any Web.config transformations for that configuration during the process
- Output the results into a folder on the local machine (no IIS, agents, zip files, FTP, packages etc, just a folder containing all the files required to run that web site)
I've been trying to figure this out for almost a week now, through the Microsoft docs (which are spectacularly unhelpful), other answers on SO and general Googling. I don't know if I'm just not getting it (which is entirely possible), or if MSBuild/MSDeploy really is the cryptic mess it currently appears to be.
Is there a reasonably simple way to achieve this? Help, please!
If you are running VS2010: ensure you have the Azure 1.7+ SDK installed (even if you're not publishing to Azure, it adds the VS2012 publishing features to VS2010)
VS2012+ have these featured built in
Or if you are building the solution file:
Either way, you can also set
/p:PrecompileBeforePublish=true
and the output will be a precompiled version of the site.Once you have the Azure SDK installed you would usually create a publish profile and simply use
/p:PublishProfile=DeployToFolder
but I've given you the manual command line in case you're not interested in going all-in with the new publishing stuff.