Tuesday, April 15, 2003 7:53 PM
Shawn A. Van Ness
Revenge of the Toolbox: Part Deux
Everybody has been following along with my little toolbox saga, right?
It just doesn't let up. Today it threw me another curve -- a timing bug! -- apparently it's failing in our test lab, on slow machines (think: sub-900 MHz laptops, w/ slow busses).
Sometimes I get a "call was rejected by the callee" exception, sometimes just silent failure (no exceptions, but no new toolbox items either). When the exceptions do occur, it's never in a predictable spot (just one of the several calls in to VS).
The bug seems to manifest on both VS 7.0 and 7.1, but I'm not 100% sure of that. I managed to repro on my high-end dev box, by cranking my SETI@Home client's process priority up to "high". ;-)
Sprinkling around a few Thread.Sleep calls seems to fix the problem nicely... well, not "nicely", but what else can I do?
Type latestDTE = Type.GetTypeFromProgID("VisualStudio.DTE");
EnvDTE.DTE dte = Activator.CreateInstance(latestDTE) as
EnvDTE.DTE;
for (int delayFudge=100; delayFudge < 5000; delayFudge += 1000)
{
try
{
AddToolboxItems(dte,delayFudge);
break; }
catch (Exception ex)
{
Debug.WriteLine(ex.Message + "\nTrying again...");
}
}
At what point do I just give up, and look for a new job?