Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Binary Serialization Issue

Binary Serialization Issue

Scheduled Pinned Locked Moved Visual Basic
helpsysadminjsonannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tmfish
    wrote on last edited by
    #1

    I'm having some issues with an attempt to serialize an object to file using a BinaryFormatter. The error I keep getting is: The type System.Runtime.Remoting.ServerIdentity in Assembly mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as serializable. Problem #1, I have no idea where I am referencing ServerIdentity. This is the method I am running in at the time of error: Private Shared Sub DumpUnprocessedDeployments() Try Dim cntr As Integer = CollInstance.Count If cntr > 0 Then logger.WriteLog("Dumping " + cntr.ToString.Trim() + " unprocessed deployments....") Dim s As Stream = File.Open("bin\webdeploy.dmp", FileMode.OpenOrCreate, FileAccess.ReadWrite) Dim bf As New BinaryFormatter Dim dpl As Deployment Dim al As New ArrayList For Each dpl In CollInstance logger.WriteLog(dpl.Project + " " + dpl.State + " " + dpl.Package + " Requester: " + dpl.User, False) bf.Serialize(s, dpl) ' <=== ERRORS OUT HERE Next s.Close() Else logger.WriteLog("No Unprocessed Deployments to Dump") End If Catch ex As Exception logger.WriteLog("An ERROR was Encountered while Generating the Dump File....") logger.WriteLog(ex.Message, False) End Try End Sub Here is the Code for the Serialized Object: Imports System Imports CM.WebDeployment.Interfaces Public Class Deployment Inherits MarshalByRefObject Implements IDeployment Private IsPending As Boolean Private RunWhen As Date Private FTPDir As String Private FTPPwd As String Private FTPSvr As String Private FTPUsr As String Private HPkg As String Private HPwd As String Private HProj As String Private HState As String Private HUsr As String #Region " Object Constructor(s) " Public Sub New() MyBase.New() End Sub Public Sub New(ByVal HarProj As String, ByVal HarState As String, ByVal HarPackage As String, _ ByVal HarUser As String, ByVal HarPassword As String, ByVal FServer As String, _ ByVal FDir As String, ByVal FUser As String, ByVal FPassword As String, _ ByVal RunTime As Date) MyBase.New() HProj = HarProj HState = HarState HPkg = HarPackage HUsr = HarUser

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups