It's evidently a symptom that can arise under several different circumstances: I found several people who saw it when causing an infinite recursion, or when running an application on a machine with certain third-party anti-virus software installed. I didn't find anything that sounded like my circumstances, so I record them here in hopes that frustrated searchers might be helped along.
My setup and architecture were as follows:
- .NET Framework 1.1;
- One UI event handler hides the main form and creates another form, displayed in its own Get/Translate/Dispatch message loop until it's closed;
- The new form creates a System.Windows.Forms timer;
- At which point, certain calls (the two I found were System.Threading.Thread.Start() and the overloaded System.Xml.XmlDocument.Load() that takes a URI string; the one taking a TextReader worked fine) cause the "Setup Error" when made from the timer elapsed event handler.
I'm still not sure exactly what I was doing wrong, or whether I was encountering a bug in the framework. I refactored the code to get rid of my inner message loop and it seems to have fixed things, so I assume that the implementation of the forms timer somehow relies on its only being maintained by the built-in message loop...but in such a way that causes only certain other methods to fail? It's a mystery.