Champ
Champ

Reputation: 53

Visual Studio 2015 Publish Profile

I have multiple publish profiles for different servers. I am wondering if there is any way how I can run all the profiles together instead of deploying one at a time?

Thanks!

Upvotes: 1

Views: 85

Answers (1)

ThorDivDev
ThorDivDev

Reputation: 741

I do it by using the command line. Create a Bat file at or near the solution. You could also use a powershell script.

Steps:

  1. Create the publish profiles in the solution for what you need, try to keep the name with no spaces to make it easier.
  2. Find out the location for devenv for your visual studio.
  3. Find out the location for msbuild for yous visual studio
  4. You may have to build or rebuild your solution because publishing may or may not build it. For this its devenv.exe sln_location /Build /Out location_build_log
  5. You could clean or delete all the contents of the destination. Sometimes keeping the files there gives error. This depends.
  6. Then execute the following command for each publish: MSBuild.exe csproj/vbproj_location /p:deployOnBuild=true /p:PublisProfile=@NAME_Publish_Profile@ /p:VisualStudioVersion=##.# Where ##.# is the version of your visual studio. VS2019 is 16.0.

Or you can publish once and with a script copy to the different servers.

Upvotes: 1

Related Questions