tags:

views:

49

answers:

1

I'm getting this error when I deploy a VB.NET application and for the life of me I cannot figure out why.

I do not get this error when I run the app from the IDE and the test machine I am deploying it to has a similar configuration to the dev machine...Windows 7 & .NET 3.51 SP1 and 4.0.

The app bombs out when the main form is loaded after logging in. I've narrowed it down to the main form because if I load another form from login and then open the main form, this happens.

Linked below is a screenshot of the stack trace.

Any ideas? I'm really lost here.

Thanks.

alt text

+1  A: 

I do not see a way for ShapeCollection.Dispose() to throw that exception. Although it is manipulating a List<> that can indeed throw that exception, the code should not trigger it:

private void Dispose(bool disposing)
{
    if (!this.m_Disposed && disposing)
    {
        for (int i = this.m_Shapes.Count - 1; i >= 0; i--)
        {
            this.m_Shapes[i].Dispose();
        }
        this.m_Shapes.Clear();
        this.m_Shapes = null;
    }
    this.m_Disposed = true;
}

Well, this is from the PowerPacks version that I have. There have been a couple of versions of it floating around, it used to be distributed separately. Make sure you didn't accidentally deploy an old version.

Hans Passant
Oh hey Hans. You think it's the PowerPacks that is causing this error?
Tom
It was the PowerPacks. I have rectangle shapes on some of my forms and when I removed them and the reference to the PowerPacks the app runs fine. Very annoyed that something so simple like a shape could mess things up so much and that I have to change the design of the app to get around this but whatever, time is of the essence and I don't want to waste anymore time on lines and rectangles.
Tom