On a recent upgrade project I needed to update the properties of a Content Query Web Part. Sounds easy enough, just need to whip a quick console app and away we go.
Coding went very quickly, but when I ran the app I couldn't get any Content Query Web Parts, they were all returned as"ErrorWebParts".
I consulted my good friend google and found this blog post . This guy was having the same issue as me and discovered that this web part references a SPContext object, unfortunately from a console app there is no web-context.