Ok. i'm having issues with serialization and i'm hopin someone can point me in the correct direction.
I have a class called Profile
<Serializable()> Public Class Profile
..... code........ methods.. blah blah..
End Class
and i have a save profile button on a form that uses this code
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
If lblb1.Text <> "" And lblb2.Text <> "" And lblb3.Text <> "" And lblb4.Text <> "" And lblb5.Text <> "" And lblb6.Text <> "" And lblb7.Text <> "" And lblb8.Text <> "" And lblb9.Text <> "" And lblb10.Text <> "" Then
'create class profile
Dim mProfile As New Profile
mProfile.addMappedItem = lblb1.Text & "|" & b1.BackColor.ToArgb
mProfile.addMappedItem = lblb2.Text & "|" & b2.BackColor.ToArgb
mProfile.addMappedItem = lblb3.Text & "|" & b3.BackColor.ToArgb
mProfile.addMappedItem = lblb4.Text & "|" & b4.BackColor.ToArgb
mProfile.addMappedItem = lblb5.Text & "|" & b5.BackColor.ToArgb
mProfile.addMappedItem = lblb6.Text & "|" & b6.BackColor.ToArgb
mProfile.addMappedItem = lblb7.Text & "|" & b7.BackColor.ToArgb
mProfile.addMappedItem = lblb8.Text & "|" & b8.BackColor.ToArgb
mProfile.addMappedItem = lblb9.Text & "|" & b9.BackColor.ToArgb
mProfile.addMappedItem = lblb10.Text & "|" & b10.BackColor.ToArgb
saveBin(mProfile) 'call the formatter method for save
End If
End Sub
Private Sub saveBin(ByVal mProfile As Profile)
Dim saveFile As IO.FileStream
SaveFileDialog1.DefaultExt = "bin"
If SaveFileDialog1.ShowDialog = DialogResult.OK Then
saveFile = IO.File.OpenWrite(SaveFileDialog1.FileName)
saveFile.Seek(0, IO.SeekOrigin.End)
Dim formatter As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
formatter.Serialize(saveFile, mProfile)
saveFile.Close()
MsgBox("saved")
End If
End Sub
Now when i run this project i get a runtime error.
--------------

I have a class called Profile
<Serializable()> Public Class Profile
..... code........ methods.. blah blah..
End Class
and i have a save profile button on a form that uses this code
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
If lblb1.Text <> "" And lblb2.Text <> "" And lblb3.Text <> "" And lblb4.Text <> "" And lblb5.Text <> "" And lblb6.Text <> "" And lblb7.Text <> "" And lblb8.Text <> "" And lblb9.Text <> "" And lblb10.Text <> "" Then
'create class profile
Dim mProfile As New Profile
mProfile.addMappedItem = lblb1.Text & "|" & b1.BackColor.ToArgb
mProfile.addMappedItem = lblb2.Text & "|" & b2.BackColor.ToArgb
mProfile.addMappedItem = lblb3.Text & "|" & b3.BackColor.ToArgb
mProfile.addMappedItem = lblb4.Text & "|" & b4.BackColor.ToArgb
mProfile.addMappedItem = lblb5.Text & "|" & b5.BackColor.ToArgb
mProfile.addMappedItem = lblb6.Text & "|" & b6.BackColor.ToArgb
mProfile.addMappedItem = lblb7.Text & "|" & b7.BackColor.ToArgb
mProfile.addMappedItem = lblb8.Text & "|" & b8.BackColor.ToArgb
mProfile.addMappedItem = lblb9.Text & "|" & b9.BackColor.ToArgb
mProfile.addMappedItem = lblb10.Text & "|" & b10.BackColor.ToArgb
saveBin(mProfile) 'call the formatter method for save
End If
End Sub
Private Sub saveBin(ByVal mProfile As Profile)
Dim saveFile As IO.FileStream
SaveFileDialog1.DefaultExt = "bin"
If SaveFileDialog1.ShowDialog = DialogResult.OK Then
saveFile = IO.File.OpenWrite(SaveFileDialog1.FileName)
saveFile.Seek(0, IO.SeekOrigin.End)
Dim formatter As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
formatter.Serialize(saveFile, mProfile)
saveFile.Close()
MsgBox("saved")
End If
End Sub
Now when i run this project i get a runtime error.
--------------