I've read many posts, documentation pages etc. regarding WebDeploy via VS2012 and via command line.
In all of the deployment scenarios, I noticed that the destination site should already exist on the destination machine (IIS).
Is there an option to create a package that creates the site if it doesn't exist on the destination (hosting) machine?
The
appHostConfig
provider will create a site on the remote server. It comes with a million caveats on setting the remote bindings and physical path, so test it in a local environment first. You'll also need to be admin (obviously).Since you are using VS2012 to perform your publish (as opposed to msdeploy directly). You should be able to automatically create the website by doing the following:
/
)<IncludeIisSettings>true</IncludeIisSettings>
inside a<PropertyGroup>
in your publish profileIt should then include
appHostConfig
in the deployment.If you want to also create the application pool, you'll need to enable
AppPoolExtension
in your publish profile: