Monday, 18 July 2011

MSDeploy "Could not find Default Web Site" issue

I was having a pretty strange issue where one of our sites was failing to deploy over MSDeploy.  We were deploying about 3 other sites to the same server, all of which were deploying fine to Default Web Site but just this one site was throwing a deployment error: Error: Site 'Default Web Sitedoes not exist..  After some googling, with no luck finding a sensible cause I tried modifying the .csproj file to clean it up so that it matched one of the successfully deploying sites.
I made the following changes that wound up sorting the issue:
1. Added a "ProductVersion" to the project file
2. Removed the empty TargetFrameworkProfile tag
3. Moved assembly signing details from Project config property groups into global propertygroup.
4. Removed DeployIisAppPhysicalPath and DeployIisAppPath tags from config propertygroups into global propertygroup.

I also then deployed the project using Visual studio before I then used our full build process.  All of this seemed to solve our issue with the "'Default Web Site' does not exist" issue for that site.