Hi,
I am trying to send the message(complex type) to the message queue.I am getting the error,ETravel.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable
.below lies the code for that.
public void QueueMessage(EmailMessage message)
{
Message msg = new Message();
msg.Body = message;
msg.Recoverable = true;
msg.Formatter = new BinaryMessageFormatter();
string queuePath = @".\private$\WebsiteEmails";
//InsureQueueExists(queuePath);
MessageQueue msgQ;
msgQ = new MessageQueue(queuePath);
msgQ.Formatter = new BinaryMessageFormatter();
msgQ.Send((object)msg);
}
The complex type EmailMessage is as follows.
public class EmailMessage
{
public string subject { get; set; }
public string message { get; set; }
public string from { get; set; }
public string to { get; set; }
}
Thanks in Advance.
I have installed the MessageQueue.
O/s: windows xp.
Technology Used:Asp.net mvc.