Usually you first configure your application on IIS, with the correct path, application pool, etc. When configuring, you can use MSBuild to deploy the application into this name as follows:
msbuild <your_web_project_name>.csproj /p:Configuration=Release /p:OutputPath=bin /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MsDeployServiceUrl=https://<url_to_your_server>:8080/msdeploy.axd /p:username=<username> /p:password=<password> /p:AllowUntrustedCertificate=True /p:DeployIisAppPath=<your_site_name> /p:MSDeployPublishMethod=WMSVC /p:VisualStudioVersion=11.0
If you do not want to configure the site manually, you can run a power shell that looks something like this:
Import-Module WebAdministration New-Item iis:\Sites\<your_site_name> -bindings @{protocol="http";bindingInformation=":80:<your_site_name>} -physicalPath c:\inetpub\wwwroot\<your_site_name> Set-ItemProperty 'IIS:\Sites\<your_site_name>' ApplicationPool "ASP.NET v4.0"
ThomasArdal
source share