Reputation: 125197
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:
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?
Upvotes: 12
Views: 9555
Reputation: 2989
This is not answering the question but may be an important node when renaming. In my case (VS 2022 17.5.2), after renaming the profile to something containing an underscore (e. g. "otp_test"), the new name is being shown with a double underscore and has to be used with double underscore like so:
MSBuild.exe mysolution.sln /p:PublishProfile=otp__test
which seems very weird to me.
The profile names in the combo box dropdown (only the drop down part of the combobox) are being shown correctly however.
Upvotes: 0
Reputation: 125197
In Visual Studio 2017 Version 15.3 you can rename the publish profile. Here are steps to rename a publish profile:
Click on Edit Publish Profile button (gear icon ) on Publish toolbar.
In the Publish page, from the drop-down that contains profiles, choose the profile that you want to rename.
In the Summary section OR Under the Actions dropdown () , Click Rename profile... link.
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.
Here are the steps to rename publish profile:
Upvotes: 19
Reputation: 5476
Just in case you can't find the PublishProfiles folder, in my web project (VS 2017 / 15.2) it is under My Project -> PublishProfiles.
Just open a file explorer window onto it and rename the offending item.
Upvotes: 0