none
Windows 8.1 has broken functionality of Microsoft.VisualBasic.PowerPacks. RRS feed

  • Question

  • I'm using RectangleShape and two LineShape objects on my form. Everything was working fine under Windows 7 and windows 8. But when I upgraded to Windows 8.1 the program works, but throws exception when closing. Here is the exception:

    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
       at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
       at Microsoft.VisualBasic.PowerPacks.ShapeCollection.Dispose(Boolean disposing)
       at Microsoft.VisualBasic.PowerPacks.ShapeContainer.Dispose(Boolean disposing)
       at System.ComponentModel.Component.Dispose()
       at System.Windows.Forms.Control.Dispose(Boolean disposing)
       at System.ComponentModel.Component.Dispose()
       at System.Windows.Forms.Control.Dispose(Boolean disposing)
       at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)
       at FractalExplorer.ImageControl.Dispose(Boolean disposing) in d:\Jacek\Documents\Visual Studio 2013\Projects\FractalExplorer\FractalExplorer\ImageControl.Designer.cs:line 23
       at System.ComponentModel.Component.Dispose()
       at System.Windows.Forms.Control.Dispose(Boolean disposing)
       at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)
       at System.Windows.Forms.Form.Dispose(Boolean disposing)
       at FractalExplorer.FormBase.Dispose(Boolean disposing) in d:\Jacek\Documents\Visual Studio 2013\Projects\FractalExplorer\FractalExplorer\FormBase.Designer.cs:line 20
       at FractalExplorer.FormJulia.Dispose(Boolean disposing) in d:\Jacek\Documents\Visual Studio 2013\Projects\FractalExplorer\FractalExplorer\FormJulia.Designer.cs:line 20
       at System.ComponentModel.Component.Dispose()
       at FractalExplorer.FormMandelbrot.FormMandelbrot_FormClosing(Object sender, FormClosingEventArgs e) in d:\Jacek\Documents\Visual Studio 2013\Projects\FractalExplorer\FractalExplorer\FormMandelbrot.cs:line 221
       at System.Windows.Forms.Form.WmClose(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34003 built by: FX45W81RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
    ----------------------------------------
    FractalExplorer
        Assembly Version: 1.0.0.3
        Win32 Version: 1.0.0.3
        CodeBase: file:///D:/Jacek/Documents/Visual%20Studio%202013/Projects/FractalExplorer/FractalExplorer/bin/Debug/FractalExplorer.exe
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34003 built by: FX45W81RTMGDR
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Numerics
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
    ----------------------------------------
    Microsoft.VisualBasic.PowerPacks.Vs
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.20911.1
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic.PowerPacks.Vs/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.PowerPacks.Vs.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    Microsoft.VisualBasic
        Assembly Version: 10.0.0.0
        Win32 Version: 12.0.20806.33440 built by: FX45W81RTMREL
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.

    StackTrace "   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()\r\n   at Microsoft.VisualBasic.PowerPacks.ShapeCollection.Dispose(Boolean disposing)\r\n   at Microsoft.VisualBasic.PowerPacks.ShapeContainer.Dispose(Boolean disposing)\r\n   at System.ComponentModel.Component.Dispose()\r\n   at System.Windows.Forms.Control.Dispose(Boolean disposing)\r\n   at System.ComponentModel.Component.Dispose()\r\n   at System.Windows.Forms.Control.Dispose(Boolean disposing)\r\n   at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)\r\n   at FractalExplorer.ImageControl.Dispose(Boolean disposing) in d:\\Jacek\\Documents\\Visual Studio 2013\\Projects\\FractalExplorer\\FractalExplorer\\ImageControl.Designer.cs:line 20\r\n   at System.ComponentModel.Component.Dispose()\r\n   at System.Windows.Forms.Control.Dispose(Boolean disposing)\r\n   at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)\r\n   at System.Windows.Forms.Form.Dispose(Boolean disposing)\r\n   at FractalExplorer.FormBase.Dispose(Boolean disposing) in d:\\Jacek\\Documents\\Visual Studio 2013\\Projects\\FractalExplorer\\FractalExplorer\\FormBase.Designer.cs:line 20\r\n   at FractalExplorer.FormJulia.Dispose(Boolean disposing) in d:\\Jacek\\Documents\\Visual Studio 2013\\Projects\\FractalExplorer\\FractalExplorer\\FormJulia.Designer.cs:line 20\r\n   at System.ComponentModel.Component.Dispose()\r\n   at FractalExplorer.FormMandelbrot.FormMandelbrot_FormClosing(Object sender, FormClosingEventArgs e) in d:\\Jacek\\Documents\\Visual Studio 2013\\Projects\\FractalExplorer\\FractalExplorer\\FormMandelbrot.cs:line 221\r\n   at System.Windows.Forms.Form.WmClose(Message& m)\r\n   at System.Windows.Forms.Form.WndProc(Message& m)\r\n   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)" string

    Clearly it fails when disposing PowerPacks objects. But it was working with previous Windows versions. I'm amateur programmer so I have no clue how to fix it. I can capture portion of the designer code that preforms disposing into try - catch such as this:

    protected override void Dispose(bool disposing)
    {
    try // added manually
    {   
    if (disposing && (components != null))
    {
    components.Dispose();
    }
    base.Dispose(disposing);
    }
    catch (Exception) // added manually
    {
    }
    }

    This "fixes" the program, but obviously it fails to free resources so it is just an ugly cover instead of a fix.

    Tuesday, October 22, 2013 12:42 AM

Answers