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:
- Run Visual Studio 2012 as administrator
- Ensure that "Use Local IIS Server" is set in project properties
- Ensure that "Project Url" is correct (and, if a virtual directory, does not end in a
/
)
- Declare
<IncludeIisSettings>true</IncludeIisSettings>
inside a <PropertyGroup>
in your publish profile
It 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:
<PropertyGroup>
<PublishEnableLinks>AppPoolExtension</PublishEnableLinks>
</PropertyGroup>