As the portal noted, you can control the application name on the properties page. I will talk a little about this answer.
Set default value on PP / Web tab
By default, when you package / publish your web project, we will create a Web Deploy parameter named IIS Web Application Name that controls this value. The default value for this is ProjectName_deploy . The reason we add the _deploy suffix for IIS scripts. You may already have an IIS application named ProjectName , but it is much less likely that you will have one ProjectName_deploy name. You can configure this value on the Package / Publish Web tab of the project properties. One thing to keep in mind if you are following this route is that all of these options are tied to a configuration configuration. . Therefore, if you configure the settings in Debug and create your package using Release, these settings will not apply. See image below.

When you set this value, it sets the MSBuild property, DeployIisAppPath, and you can use it if you want to have some logic associated with the resulting value.
Pass the parameter value in the publication
If you want, you can also simply specify the value of this parameter when publishing. Here you have two main approaches.
- Specify a value for an individual property
- Specify a value for this and other properties in the file
1. Specify a value for an individual property:
You can use the -setParam parameter when calling msdeploy.exe to give a new value for this parameter. For example:
%msdeploy% -verb:sync -source:package=WebApplication3.zip -dest:auto -setParam:name="IIS Web Application Name",value="Default Web Site/FooBar"
2. Specify a value for this and other properties in the file
When you create a package in VS, we automatically create a file for you called {ProjectName} .SetParameters.xml. This file is a simple XML file and it will contain all the parameters along with the default values. You can update this file to include the correct parameter values, and then transfer it to the msdeploy.exe file (note: you do not need to name the file ... SetParameters.xml you can rename it at any convenient for you). If you want to use this approach, just use the -setParamFile option when calling msdeploy.exe. The following is an example of command line syntax for this:
%msdeploy% -verb:sync -source:package=WebApplication3.zip -dest:auto -setParamFile=WebApplication3.SetParameters.xml
Sayed Ibrahim Hashimi
source share