G
Guest
I'm trying to implement sending an object through messaging, but I receive an
error stating I can't deserialize the object. Any clues as to why.
I have the following:
<Serializable()> Public Class navMessage
dim m_Category as int32
dim m_Id as string
property Category() as int32
Get
return m_Category
end get
set (byval value as int32)
m_Category = value
end set
end property
property MsgId() as string
Get
return m_Id
end get
set (byval value as string)
m_Id = value
end set
end property
end class
Note: .\NavTest queue exists
In the first application I do the following:
dim mq as MessageQueue(".\NavTest")
dim oMsg as new navMessage
oMsg.MsgId = "Test"
oMsg.Category = 100
mq.formatter = new binarymessageformatter
mq.send(oMsg)
In the second application I do the following:
dim mq as MessageQueue(".\NavTest")
dim oMsg as navMessage
oMsg = CType(mq.receive().body, navMessage) **
** this line give me the following error:
Cannot deserialize the message passed as an argument. Cannot recognize the
serialization format.
error stating I can't deserialize the object. Any clues as to why.
I have the following:
<Serializable()> Public Class navMessage
dim m_Category as int32
dim m_Id as string
property Category() as int32
Get
return m_Category
end get
set (byval value as int32)
m_Category = value
end set
end property
property MsgId() as string
Get
return m_Id
end get
set (byval value as string)
m_Id = value
end set
end property
end class
Note: .\NavTest queue exists
In the first application I do the following:
dim mq as MessageQueue(".\NavTest")
dim oMsg as new navMessage
oMsg.MsgId = "Test"
oMsg.Category = 100
mq.formatter = new binarymessageformatter
mq.send(oMsg)
In the second application I do the following:
dim mq as MessageQueue(".\NavTest")
dim oMsg as navMessage
oMsg = CType(mq.receive().body, navMessage) **
** this line give me the following error:
Cannot deserialize the message passed as an argument. Cannot recognize the
serialization format.