Guten Morgen allerseits,
als Neuling hier möchte ich mich kurz vorstellen: Ich bin der Christopher und als Softwareentwickler in einem Konzern tätig.
So, und nun gleich zu meinem Problem. Ich bekomme, wenn ich eine Datei zu einem Objekt deserialisieren möchte, folgende Exception:
TargetInvocationException: "Ein Aufrufziel hat einen Ausnahmefehler verursacht."
bei System.RuntimeMethodHandle._SerializationInvoke(IRuntimeMethodInfo method, Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
bei System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
bei System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
bei System.Runtime.Serialization.ObjectManager.DoFixups()
bei System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
bei ETAuswertung.Serialization.Deserialize(Byte[] Data) in C:\01_DATA\ETAuswertung\Quellcode\ETAuswertung\Serialization.vb:Zeile 18.
bei ETAuswertung.frmMainWindow.mniLoadPackaage_Click(Object sender, EventArgs e) in C:\01_DATA\ETAuswertung\Quellcode\ETAuswertung\frmMainWindow.vb:Zeile 350.
bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
bei System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
bei System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ToolStrip.WndProc(Message& m)
bei System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei ETAuswertung.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
Dabei ist folgende InnerException aufgetreten:
DataException: Undefinierter Datentyp: ''.
bei System.Data.XSDSchema.XsdtoClr(String xsdTypeName)
bei System.Data.Common.ObjectStorage.ConvertXmlToObject(XmlReader xmlReader, XmlRootAttribute xmlAttrib)
bei System.Data.XmlDataLoader.LoadColumn(DataColumn column, Object[] foundColumns)
bei System.Data.XmlDataLoader.LoadTable(DataTable table, Boolean isNested)
bei System.Data.XmlDataLoader.LoadData(XmlReader reader)
bei System.Data.DataSet.ReadXmlDiffgram(XmlReader reader)
bei System.Data.DataSet.ReadXml(XmlReader reader, XmlReadMode mode, Boolean denyResolving)
bei System.Data.DataSet.DeserializeDataSetData(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat)
bei System.Data.DataSet.GetSerializationData(SerializationInfo info, StreamingContext context)
bei ETAuswertung.ClientDataSet..ctor(SerializationInfo info, StreamingContext context) in C:\01_DATA\ETAuswertung\Quellcode\ETAuswertung\Package\ClientDataSet.Designer.vb:Zeile 93.
Der Programmteil, in dem der Fehler auftritt:
Das Serialisieren funktioniert einwandfrei, wenn ich das Objekt danach wieder deserialisieren möchte, schmeißt es den Fehler. Ich hab schon ohne Ende Google bemüht, weiß aber immer noch nicht, was eigentlich los ist.
Ich programmiere mit Visual Studio 2010 Professional und .net-Framework 4.0.
Vielen Dank und viele Grüße
Christopher
als Neuling hier möchte ich mich kurz vorstellen: Ich bin der Christopher und als Softwareentwickler in einem Konzern tätig.
So, und nun gleich zu meinem Problem. Ich bekomme, wenn ich eine Datei zu einem Objekt deserialisieren möchte, folgende Exception:
TargetInvocationException: "Ein Aufrufziel hat einen Ausnahmefehler verursacht."
bei System.RuntimeMethodHandle._SerializationInvoke(IRuntimeMethodInfo method, Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
bei System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
bei System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
bei System.Runtime.Serialization.ObjectManager.DoFixups()
bei System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
bei ETAuswertung.Serialization.Deserialize(Byte[] Data) in C:\01_DATA\ETAuswertung\Quellcode\ETAuswertung\Serialization.vb:Zeile 18.
bei ETAuswertung.frmMainWindow.mniLoadPackaage_Click(Object sender, EventArgs e) in C:\01_DATA\ETAuswertung\Quellcode\ETAuswertung\frmMainWindow.vb:Zeile 350.
bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
bei System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
bei System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ToolStrip.WndProc(Message& m)
bei System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei ETAuswertung.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
Dabei ist folgende InnerException aufgetreten:
DataException: Undefinierter Datentyp: ''.
bei System.Data.XSDSchema.XsdtoClr(String xsdTypeName)
bei System.Data.Common.ObjectStorage.ConvertXmlToObject(XmlReader xmlReader, XmlRootAttribute xmlAttrib)
bei System.Data.XmlDataLoader.LoadColumn(DataColumn column, Object[] foundColumns)
bei System.Data.XmlDataLoader.LoadTable(DataTable table, Boolean isNested)
bei System.Data.XmlDataLoader.LoadData(XmlReader reader)
bei System.Data.DataSet.ReadXmlDiffgram(XmlReader reader)
bei System.Data.DataSet.ReadXml(XmlReader reader, XmlReadMode mode, Boolean denyResolving)
bei System.Data.DataSet.DeserializeDataSetData(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat)
bei System.Data.DataSet.GetSerializationData(SerializationInfo info, StreamingContext context)
bei ETAuswertung.ClientDataSet..ctor(SerializationInfo info, StreamingContext context) in C:\01_DATA\ETAuswertung\Quellcode\ETAuswertung\Package\ClientDataSet.Designer.vb:Zeile 93.
Der Programmteil, in dem der Fehler auftritt:
VB.NET-Quellcode
- Public Shared Function Deserialize(Data As Byte()) As Object
- Dim ms As New MemoryStream(Data)
- Dim formatter As New Runtime.Serialization.Formatters.Binary.BinaryFormatter()
- Dim instance As Object = formatter.Deserialize(ms) 'Zeile, in der die Exception auftritt.
- ms.Close()
- Return instance
- End Function
Das Serialisieren funktioniert einwandfrei, wenn ich das Objekt danach wieder deserialisieren möchte, schmeißt es den Fehler. Ich hab schon ohne Ende Google bemüht, weiß aber immer noch nicht, was eigentlich los ist.
Ich programmiere mit Visual Studio 2010 Professional und .net-Framework 4.0.
Vielen Dank und viele Grüße
Christopher