How can I rename Publish Profile in Visual Studio 2017?

Reza Aghaei picture Reza Aghaei · Jul 12, 2017 · Viewed 7.4k times · Source

In Visual Studio 2017 when you create a custom Publish Profile, you don't have an option to set name of the profile and it creates profiles with default names like CustomProfile and CustomProfile1 and show them in Publish toolbar like this:

enter image description here

In previous versions of Visual Studio, when you create a publish profile, there is a dialog asking for profile name. How can I rename publish profile in Visual Studio 2017?

Answer

Reza Aghaei picture Reza Aghaei · Jul 12, 2017

Visual Studio 2017 Version >= 15.3

In Visual Studio 2017 Version 15.3 you can rename the publish profile. Here are steps to rename a publish profile:

  1. Click on Edit Publish Profile button (gear icon enter image description here) on Publish toolbar.

  2. In the Publish page, from the drop-down that contains profiles, choose the profile that you want to rename.

  3. In the Summary section OR Under the Actions dropdown (enter image description here) , Click Rename profile... link.

  4. In the Rename Profile window, enter the new name and click Save button.

The profile name will be changed immediately and if you open the drop-down menu, you will see the new name for the profile.

If you are using a version lower than 15.3, then you can upgrade to 15.3 or read the next part of the answer.

Workaround for Visual Studio 2017 Version < 15.3

Publish profiles are .pubxml files and Visual Studio 2017 shows a list of file names in Publish toolbar. To change name of publish profile, you should change file name and then unload and reload project.

enter image description here

Here are the steps to rename publish profile:

  1. Go to Solution ExplorerProjectPropertiesPublishProfiles
  2. Choose the file which you want to rename it and rename it.
  3. Right click on Project and choose Unload Project
  4. Right click on Project and choose Reload Project