Could not start IIS web site
"The World Wide Web Publishing Service (WWW Service) did not construct valid URLs for virtual site %1. Therefore, the virtual site %1 will be stopped. This can be caused by invalid characters in the site bindings. The following characters are not allowed in a site binding: "\"" "/" "\\" "[" "]" ":" "|" " " "<" ">" "+" "=" ";" "," "?" "*" "%" "#" "@" "{" "}" "^" "`". To fix this problem please remove invalid characters from the site bindings."
So when you try and start a website in IIS, you see a dialog:
Which is a really lazy error since like most lazy errors, it only makes sense when you know what has caused it and in many cases you don't
So fortunately, the Event Viewer has more details in the System log under IIS-W3SVC. It says the message at the top and helpfully says that the bindings might have invalid characters. Unfortunately, since IIS is so old and flaky, you can't just click the bindings link to open the bindings dialog, this displays:
Which basically stops you from finding out what is wrong.
Fortunately, I was deploying from Octopus Deloy and using the verbose logs, I found where it was adding the bindings from my project. One of the bindings was using parameter subsitution to use the name of the environment as a prefix. My new environment was called "Functional Test" with a space, which creates an invalid binding since spaces are not allowed in URL hostnames!
So I corrected it and the world was once-again content.