H
Hans Baumann
Hi everybody,
I get the following message when trying to serialize an object: "Unhandled
Exception: System.IO.FileNotFoundException: File or assembly name XXX.dll or
one of its dependencies, was not found.File name: XXX.dll"
This ocurrs with this code:
Module Module1
Sub Main()
Dim p As MyAssemblyNamespace.MyClass = MyClass.Instatiate()
Dim ser As New XmlSerializer(GetType(Persona))
Dim fs As New FileStream("c:\temp\result.xml", IO.FileMode.Create)
ser.Serialize(fs, p)
fs.Close()
End Sub
End Module
But when I use this other it works fine:
Module Module1
Sub Main()
Dim p As MyAssemblyNamespace.MyClass = MyClass.Instatiate()
Dim ser As New SoapFormatter
Dim fs As New FileStream("c:\temp\result.xml", IO.FileMode.Create)
ser.Serialize(fs, p)
fs.Close()
End Sub
End Module
It also works fine with a class defined in the same assembly...
What am I doing wrong?
Thanks in advance.
I get the following message when trying to serialize an object: "Unhandled
Exception: System.IO.FileNotFoundException: File or assembly name XXX.dll or
one of its dependencies, was not found.File name: XXX.dll"
This ocurrs with this code:
Module Module1
Sub Main()
Dim p As MyAssemblyNamespace.MyClass = MyClass.Instatiate()
Dim ser As New XmlSerializer(GetType(Persona))
Dim fs As New FileStream("c:\temp\result.xml", IO.FileMode.Create)
ser.Serialize(fs, p)
fs.Close()
End Sub
End Module
But when I use this other it works fine:
Module Module1
Sub Main()
Dim p As MyAssemblyNamespace.MyClass = MyClass.Instatiate()
Dim ser As New SoapFormatter
Dim fs As New FileStream("c:\temp\result.xml", IO.FileMode.Create)
ser.Serialize(fs, p)
fs.Close()
End Sub
End Module
It also works fine with a class defined in the same assembly...
What am I doing wrong?
Thanks in advance.