Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I publish site from command line with some publish profile?

Something like

msbuild /t:publish [use PublishProfileName] someproject.csproj

like image 628
dotneter Avatar asked Aug 05 '10 08:08

dotneter


People also ask

How do I get a published profile?

Publish profiles can simplify the publishing process, and any number of profiles can exist. Create a publish profile in Visual Studio by choosing one of the following paths: Right-click the project in Solution Explorer and select Publish. Select Publish {PROJECT NAME} from the Build menu.

What is publish profile in MSBuild?

Publish uses profiles (. pubxml files) to allow for multiple project configurations and multiple publish targets for a single project. The contents of the profile are XML and based on MSBuild. The Publish profile keeps credentials in a separate, hidden by default file that doesn't get checked-in.

Where is publish profile stored?

Publish profile files are named <profilename>. pubxml and are located in the PublishProfiles folder. The PublishProfiles folder is under Properties in a C# web application project, under My Project in a VB web application project, or under App_Data in a web site project.

What does a publish command do in CLI?

\publish sends publish output for each project to a publish folder under the folder that contains the project file. If you specify a relative path when publishing a project, the generated output directory is relative to the project file location, not to the current working directory.


1 Answers

msbuild MyProject.csproj /t:PipelinePreDeployCopyAllFilesToOneFolder /p:Configuration=Release;_PackageTempDir=C:\temp\somelocation;AutoParameterizationWebConfigConnectionStrings=false

See MSBuild 2010 - how to publish web app to a specific location (nant)?

For Visual Studio 2012 you can use

msbuild MySolution.sln /p:DeployOnBuild=true;PublishProfile=Production;Password=foo

See ASP.NET Web Deployment using Visual Studio: Command Line Deployment

like image 142
Pavel Chuchuva Avatar answered Oct 21 '22 00:10

Pavel Chuchuva