3
Vote

Error: Unable to cast object of type 'ObjectCollection' to type 'System.Collections.Generic.IList`1[System.String]'.

description

Hello,
 
First of all: Great GUI!
However, I get an error when creating a new file copy Job where my source is an unc path:
 
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
 
************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'ObjectCollection' to type 'System.Collections.Generic.IList`1[System.String]'.
at BitsDownloadMgr.Jobs.FileCopyJobCreator.get_FilesToCopy()
at BitsDownloadMgr.Jobs.FileCopyJobCreator.CreateJob(CopyManager manager, IWin32Window ownerWindow)
at BitsDownloadMgr.UI.BitsStatusForm.createJob(ICreateJob jobCreator)
at BitsDownloadMgr.UI.BitsStatusForm.creatorButton_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.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.1434 (REDBITS.050727-1400)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

BitsDownloadMgr.UI
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0

CodeBase: file:///C:/Program%20Files/BITS%20Download%20Manager/BitsDownloadMgr.UI.exe

System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

BitsDownloadMgr.Interop
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0

CodeBase: file:///C:/Program%20Files/BITS%20Download%20Manager/BitsDownloadMgr.Interop.DLL

BitsDownloadMgr.Jobs
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0

CodeBase: file:///C:/Program%20Files/BITS%20Download%20Manager/BitsDownloadMgr.Jobs.DLL

System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

-eslssdr
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.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.

file attachments

comments

madhumun wrote Sep 1, 2009 at 3:04 PM

Hi guys,
     I am trying to load the BitsDownloadMgr.Job and BitsDownloadMgr.Introp in my VS 2008 .NET 3.5 web and win application, so I am not able to access some of the APIs are called IBackgroundCopyJob etc., It's showing the exceptions as : BitsDownloadMgr.Interop.IBackgroundCopy is inaccessible due to Protection level.
Please send me the solution asap. Looking for the positive response.

Thank you
Madhu

wrote Sep 1, 2009 at 3:04 PM

wrote Feb 13, 2013 at 11:35 PM