Adding Attributes at Runtime

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

I would like to add the Serializable attribute to an object at
runtime. I want to send a System.Web.Mail.MailMessage over the line
using Remoting, but MailMessage is not serializable.

Thanks in advance,
Rob
 
Rob,

The MailMessage class is not sealed, so you could create your own class
that derives from it, tagging it with the Serializable attribute.

You can not add attributes to a type at runtime.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top