When clicking on a website in IIS, you get this error:
Site 2 has no root application defined, so the site will be ignored
Also this error appears in the event log:
Event Log: System
Event ID: 5161
Site 2 has no root application defined, so the site will be ignored.
In my case I got Site 2 has no root application defined because I had uninstalled a SharePoint website, but the install hadn’t removed the IIS website, but had removed the associated Application Pool.
To fix this, I simply loaded IIS, right clicked the website (closed the error) and clicked “Remove”, then “Yes”. It was a bit of a leap of faith that the correct website was going to be removed, because I couldn’t get it to highlight the erroneous website, but it did work without any side effects so far 🙂