This project has moved. For the latest updates, please go here.

Unhandled Exception when copying connection.

Topics: Developer Forum
Oct 15, 2007 at 6:50 PM
Myself and two others are able to reproduce an unhandled exception when copying a connection under "Organize Favorites".
1. Create a new connection - configure it as RDP and click OK
2. Select the connection from step one and click Copy
3. Select the "Copy of ..." connection and click Edit
4. Change the name of the connection and server the click OK
5. The unhandled exception dialogue appears

It is possible to continue at this point and set up all the connections then delete the "Copy of ..." connection created in Step 3. Below is the info from the just-in-time debugger.

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

                            • Exception Text **************
System.Configuration.ConfigurationErrorsException: An error occurred executing the configuration section handler for settings. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at System.Configuration.ConfigurationElementCollection.Unmerge(ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode)
at System.Configuration.ConfigurationElement.Unmerge(ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode)
at System.Configuration.ConfigurationSection.SerializeSection(ConfigurationElement parentElement, String name, ConfigurationSaveMode saveMode)
at System.Configuration.MgmtConfigurationRecord.GetConfigDefinitionUpdates(Boolean requireUpdates, ConfigurationSaveMode saveMode, Boolean forceSaveAll, ConfigDefinitionUpdates& definitionUpdates, ArrayList& configSourceUpdates)
--- End of inner exception stack trace ---
at System.Configuration.MgmtConfigurationRecord.GetConfigDefinitionUpdates(Boolean requireUpdates, ConfigurationSaveMode saveMode, Boolean forceSaveAll, ConfigDefinitionUpdates& definitionUpdates, ArrayList& configSourceUpdates)
at System.Configuration.MgmtConfigurationRecord.SaveAs(String filename, ConfigurationSaveMode saveMode, Boolean forceUpdateAll)
at System.Configuration.Configuration.SaveAsImpl(String filename, ConfigurationSaveMode saveMode, Boolean forceSaveAll)
at System.Configuration.Configuration.Save()
at Terminals.Settings.EditFavorite(String oldName, FavoriteConfigurationElement favorite) in C:\Source\Terminals\Terminals\Settings.cs:line 294
at Terminals.Settings.EditFavorite(String oldName, FavoriteConfigurationElement favorite, Boolean showOnToolbar) in C:\Source\Terminals\Terminals\Settings.cs:line 306
at Terminals.OrganizeFavoritesForm.EditFavorite(FavoriteConfigurationElement favorite) in C:\Source\Terminals\Terminals\OrganizeFavoritesForm.cs:line 66
at Terminals.OrganizeFavoritesForm.btnEdit_Click(Object sender, EventArgs e) in C:\Source\Terminals\Terminals\OrganizeFavoritesForm.cs:line 56
at System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
at System.Windows.Forms.ListView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


                            • Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Terminals
Assembly Version: 1.6.0.0
Win32 Version: 1.6.0.0
CodeBase: file:///D:/Terminals/Terminals.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GACMSIL/System.Windows.Forms/2.0.0.0_b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GACMSIL/System/2.0.0.0_b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GACMSIL/System.Drawing/2.0.0.0_b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GACMSIL/System.Configuration/2.0.0.0_b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GACMSIL/System.Xml/2.0.0.0_b77a5c561934e089/System.Xml.dll
----------------------------------------
TabControl
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Terminals/TabControl.DLL
----------------------------------------
Metro
Assembly Version: 1.0.3.0
Win32 Version: 1.0.3.0
CodeBase: file:///D:/Terminals/Metro.DLL
----------------------------------------
AxInterop.MSTSCLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Terminals/AxInterop.MSTSCLib.DLL
----------------------------------------
VncSharp
Assembly Version: 0.88.0.0
Win32 Version: 0.88.0.0
CodeBase: file:///D:/Terminals/VncSharp.DLL
----------------------------------------
TransPort2006
Assembly Version: 3.0.1.7
Win32 Version: 3.0.1.7
CodeBase: file:///D:/Terminals/TransPort2006.DLL
----------------------------------------
Interop.MSTSCLib6
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Terminals/Interop.MSTSCLib6.DLL
----------------------------------------
Interop.MSTSCLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Terminals/Interop.MSTSCLib.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.
Coordinator
Oct 15, 2007 at 8:53 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.