I have a POCO (plain old clr object) stored in session, and would like to be able to reference properties from that object from within another process (B). I don't want the stand-alone process (B) to require a reference to the dll in which the poco's class is defined. Is it possible to convert the saved object (in session) to something readable (e.g. xml) without referencing the object's class?
You would have to create your own custom code to serialize and/or deserialize the object.
Without a reference to the assembly .NET does not have the needed meta data to do the work for you.
You can just add an attribute to the generated XML to specify the object type.
<Object Type="1">
<Property1>Value</Property1>
</Object>
Of course the destination code would need to know what to do with this type attribute, but you would not need to reference the actual .NET assembly.
you cant you need the assembly to get the metadata of the object, maybe you can avoid the reference to the dll and use reflection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With