it could be other things but in my case (which is common apparently) is was just caused by having an ampersand (&) within one of the values in the web.config/app.config appsettings key-value pairs
the fix is to simply change & to &
this is because the xml reader is not able to parse the *.config file properly unless the value is xml encoded. this applies for these characters as well (and their correct/encoded representation)
" "
' '
< <
> >
& &
there could be various other complex reasons (you can search for the full string online and you will find them)
but hope that helps