JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
Well,
I'll try to give enough information here, because well, I really don't know what the cause could be. The error is definitely involving the System.Linq.Enumerable Extensions, but how or why I don't think i'll be able to figure out.
Basically, i have .Net 3.5 on both systems installed, as it is a .Net 3.5 application, and I often use some frequent "casts" as part of the System.Linq.Enumerable Cast(Of T) extension.
here is the offending line (the line separators have been added for formatting benefit and readability on this forum it is all on one line in the source):
Join() is a Wrapper extension of my own defined as:
and uses the Array.Join() method, and in this situation _sheets is defined
Later I redefine _sheets() with the index of each Sheet() in an Excel file to correlate to a DataSet map of Excel Column Headers per Worksheet in a Workbook. As the user selects a worksheet in my interface, it knows which ChildTables to refer to for the column headers in the dataset.
On my system, the Development System, it works fine, without any issues, but after transferring the application to another system, it has decided to come up with an exception specifically oriented on that line, which is telling me that the Cast(Of String) from an integer Array is not working on a system other than mine. I currently don't know enough about the Linq or 3.5 environment to discern what could cause this to work in one place and not in another, but I assure you that 2.0/3.5 are installed on both systems. (I will admit, that there is a possiblity that my system is 3.5 and the other system is 3.5 SP1 but that should be backwards compatible.)
Here is the Exception for clarification.
Thanks so much, i really need help on this one.
I'll try to give enough information here, because well, I really don't know what the cause could be. The error is definitely involving the System.Linq.Enumerable Extensions, but how or why I don't think i'll be able to figure out.
Basically, i have .Net 3.5 on both systems installed, as it is a .Net 3.5 application, and I often use some frequent "casts" as part of the System.Linq.Enumerable Cast(Of T) extension.
here is the offending line (the line separators have been added for formatting benefit and readability on this forum it is all on one line in the source):
VB.NET:
Dim dr() As RexamTables.XLColumnsRow = _
DirectCast( _
XCols.Select( _
DBCOL.FmtStr(itm.Text.SingleQuote) & _
" AND SheetID in (" & _
[U][B]_sheets.Cast(Of String).ToArray.Join(",") [/B][/U]& ")"), _
RexamTables.XLColumnsRow())
Join() is a Wrapper extension of my own defined as:
VB.NET:
function Join(of T)(items() as T, Sep as String) as String
VB.NET:
private _sheets() as Integer = {}
Later I redefine _sheets() with the index of each Sheet() in an Excel file to correlate to a DataSet map of Excel Column Headers per Worksheet in a Workbook. As the user selects a worksheet in my interface, it knows which ChildTables to refer to for the column headers in the dataset.
On my system, the Development System, it works fine, without any issues, but after transferring the application to another system, it has decided to come up with an exception specifically oriented on that line, which is telling me that the Cast(Of String) from an integer Array is not working on a system other than mine. I currently don't know enough about the Linq or 3.5 environment to discern what could cause this to work in one place and not in another, but I assure you that 2.0/3.5 are installed on both systems. (I will admit, that there is a possiblity that my system is 3.5 and the other system is 3.5 SP1 but that should be backwards compatible.)
Here is the Exception for clarification.
Source: System.Core
Message: Unable to cast object of type 'System.Int32' to type 'System.String'.
Stack: at System.Linq.Enumerable.<CastIterator>d__aa`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at RexamClean.ImportForm.OpenXL_Click(Object sender, EventArgs e) in C:\Source\Visual Studio 2008\Projects\RexamClean\RexamClean\ImportForm.vb:line 358
at RexamClean.ImportForm.ImportForm_Shown(Object sender, EventArgs e) in C:\Source\Visual Studio 2008\Projects\RexamClean\RexamClean\ImportForm.vb:line 318
at System.Windows.Forms.Form.OnShown(EventArgs e)
at System.Windows.Forms.Form.CallShownEvent()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
Thanks so much, i really need help on this one.