I had the same error message. This happened after I copied in a new version of web.config that someone made many manual changes to another environment.
I found the problem using quasi-bin search. That is, using Beyond Compare, I would copy in the first half of the changes and look, still generate an error. If this happened, I would start again and only copy in the first quarter of the changes, etc.
The error for me was the following setup:
<setting name="InvalidItemNameChars" value="\/:?"<>|[]" />
Pay attention to the symbol "more"!
I installed it by changing the setting to:
<setting name="InvalidItemNameChars" value="\/:?"<>|[]" />
source share