When I tried to run a project today and got an “Unable to start debugging on the web server” error:
According to the suggestion in the error message, I ran the project without debugging, and it did provide more information about the error:
In my web.config file, I commented out one connection string which has the server name like this: sqlserver—1, it is the “—“ that caused the parse error. Apparently, the parse error says you cannot have “—“ in comment block. If it is outside comment block, then everything is ok.
The reason is that for compatibility, the string “–” (double-hyphen) MUST NOT occur within comments, according to the XML specification.
Therefore, if you have different connection strings in web.config file for testing and production which contains double-hyphen, and instead of commenting out the testing connection string when deploying application to production, you will need to delete it to avoid the above XML parse error.