I got the same error when performing an upgrade from kentico 8.2 to 9. In my case, the problem was with the WebSite.sln file, which was (for some unknown reason) formatted to use Unix line endings. Updating this back to Windows format fixed the issue.