Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio. Publish project from command line

Is there a way to publish a web project in MS Visual Studio 2010 using CLI? I use DevEnv.exe /Build to build a project and it works fine, but I could not find option to Publish a project.

One other thing I want to mention. I am trying to publish web project NOT to the IIS directly. I have a location where I publish several projects and then build them automatically into NSIS bundle to be deployed.

like image 600
sha Avatar asked May 05 '10 16:05

sha


People also ask

How do I Publish a Visual Studio solution from the command line?

Basic command-line publishingThe default publish folder format is bin\Debug\{TARGET FRAMEWORK MONIKER}\publish\. For example, bin\Debug\netcoreapp2. 2\publish\. The dotnet publish command calls MSBuild, which invokes the Publish target.

How do I Publish a Visual Studio project?

Right-click on the project (not the solution) in Solution Explorer and select Publish. In the Publish tab, select Publish. Visual Studio writes the files that comprise your application to the local file system. The Publish tab now shows a single profile, FolderProfile.

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

From ASP.NET Web Deployment using Visual Studio: Command Line Deployment, you can use

msbuild myproject.csproj /p:DeployOnBuild=true /p:PublishProfile=MyPublishProfile 

where MyPublishProfile is the profile name that you've already set up somewhere

like image 99
dten Avatar answered Oct 12 '22 12:10

dten