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?

        // Get DTE from version-indep progid (points to newest)
        Type latestDTE = Type.GetTypeFromProgID("VisualStudio.DTE");
        EnvDTE.DTE dte = Activator.CreateInstance(latestDTE) as
            EnvDTE.DTE;

        // Repeat attempt to drive VS, with ever-increasing handicap
        for (int delayFudge=100; delayFudge < 5000; delayFudge += 1000)
        {
            try
            {
                AddToolboxItems(dte,delayFudge);
                break// exit loop
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message + "\nTrying again...");
            }
        }

At what point do I just give up, and look for a new job?

Comments

# All quiet along the Toolbox front... : Shawn A. Van Ness's Blog

Tuesday, April 15, 2003 10:53 PM by TrackBack

All quiet along the Toolbox front... : Shawn A. Van Ness's Blog

# re: Revenge of the Toolbox: Part Deux

Wednesday, April 16, 2003 1:01 PM by Scott Swigart

Ah, the old "call was rejected by the callee" exception. I ran into that myself, and never did find a good solutions (I also tried the "I'll wait a minute and try again" approach, but I never achieved 100% reliability. Good luck.

# re: Toolbox Stupidity - Visual Studio 2003

Monday, July 12, 2004 5:19 AM by TrackBack