D
dudi
Hi, very puzzling...
I have one perfectly working solution, in which I use a a.dll which has a
class A. that class loads data from
the database and for each row deserialize the cell into class A1. works
great.
I made a new solution, I linked to the same a.dll, and In a new project in
this new solution I call the same function in a.dll that will load the
datatable and for each row deserialize the info into class A1.
however, this time in the line of code that calls the deserialize I get:
An unhandled exception of type
'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.
I tried several thinks, first I checked I am using in both solution vs.NET
2003 and not 2002 in one of them by mistake, I tried copying the code that
does the deserialization into the new solution instead of linking to a.dll,
I also tried adding the a.dll project to the new solution (instead of just
adding a reference to the dll)... nothing works. I get that exception and I
can not make any sense of it!
the only intuition I have is that it might be because of security or name
space issues that deserialization is known to be sensitive to, but I can not
find any path to the light. any ideas?
some code follows:
Dim dt As DataTable = _dbmaster.getDataTable(_sqlSel)
Dim row As DataRow
Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim topic As iProgramTopic.Topic
For Each row In dt.Rows
Dim byts As Byte() = CType(row("srlz"), Byte())
Dim ms As New IO.MemoryStream(byts)
topic = CType(bf.Deserialize(ms), iProgramTopic.Topic)
'------------EXCEPTION!!!!!---------
_ht.Add(topic.topicId.strKey, topic)
Next
regards.
I have one perfectly working solution, in which I use a a.dll which has a
class A. that class loads data from
the database and for each row deserialize the cell into class A1. works
great.
I made a new solution, I linked to the same a.dll, and In a new project in
this new solution I call the same function in a.dll that will load the
datatable and for each row deserialize the info into class A1.
however, this time in the line of code that calls the deserialize I get:
An unhandled exception of type
'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.
I tried several thinks, first I checked I am using in both solution vs.NET
2003 and not 2002 in one of them by mistake, I tried copying the code that
does the deserialization into the new solution instead of linking to a.dll,
I also tried adding the a.dll project to the new solution (instead of just
adding a reference to the dll)... nothing works. I get that exception and I
can not make any sense of it!
the only intuition I have is that it might be because of security or name
space issues that deserialization is known to be sensitive to, but I can not
find any path to the light. any ideas?
some code follows:
Dim dt As DataTable = _dbmaster.getDataTable(_sqlSel)
Dim row As DataRow
Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim topic As iProgramTopic.Topic
For Each row In dt.Rows
Dim byts As Byte() = CType(row("srlz"), Byte())
Dim ms As New IO.MemoryStream(byts)
topic = CType(bf.Deserialize(ms), iProgramTopic.Topic)
'------------EXCEPTION!!!!!---------
_ht.Add(topic.topicId.strKey, topic)
Next
regards.