How to rename a publishing profile in Visual Studio 2017?

In Visual Studio 2017, when you create your own publishing profile, you have no way to set the profile name, and it creates profiles with default names such as CustomProfile and CustomProfile1 , and show them in the publication panel, for example this:

enter image description here

In previous versions of Visual Studio, when you create a publication profile, a dialog box appears asking for the name of the profile. How to rename a publishing profile in Visual Studio 2017?

+8
source share
3 answers

Visual Studio 2017 version> = 15.3

In Visual Studio 2017 version 15.3, you can rename a publication profile. Here are the steps to rename a publication profile:

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

  2. On the publication page, from the profiles drop-down list, select the profile you want to rename.

  3. In the Summary section OR In the Actions drop-down list ( enter image description here ) click on the "Rename profile ..." link.

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

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

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

Workaround for Visual Studio 2017 version <15.3

Publishing profiles are .pubxml files .pubxml and Visual Studio 2017 displays a list of file names in the publishing toolbar. To change the name of a publication profile, you must change the file name, and then upload and reload the project.

enter image description here

Here are the steps to rename a publish profile:

  1. Go to Solution Explorer โ†’ Project โ†’ Properties โ†’ Publish Profiles
  2. Select the file you want to rename and rename it.
  3. Right-click on Project and select Unload Project.
  4. Right-click Project and select Update Project.
+16
source

When publishing a console application, this option is a bit hidden:

enter image description here

+1
source

Just in case, if you cannot find the PublishProfiles folder, in my web project (VS 2017 / 15.2) it is in the My Project โ†’ PublishProfiles section.

Just open the file explorer window and rename it.

0
source

Source: https://habr.com/ru/post/1269741/


All Articles