NET - What is Type Forwarding in NET?

What is Type Forwarding in NET? Explain steps to move a type from one class library to another.

Type forwarding is a technique to move types from one assembly to another without the clients needing to recompile the assemblies.

Steps:
Assuming we are moving a type called Student from Assembly A to Assembly B

1. Remove definition of Student in Assembly A and replace it with TypeForwardedTo attribute.
Example:
[assembly: TypeForwardedTo(typeOF(AssemblyA.Student)))]

2. Put the definition of Student in AssemblyB.
3. Rebuild both assemblies and deploy.
NET - What is SOAPFormatter? Explain how to serialize an object
What is SOAPFormatter? - It is an xml based serialization technique which is used to serialize and deserialize objects and data across networks.......
NET - Explain why we use XML Serialization
Explain why we use XML Serialization - Serialization allows persisting objects. XML serializations stores objects in form of XML which has become a storage standard......
NET - Explain how to use XML to Serialize an object.
Explain how to use XML to Serialize an object - Use the namespace “System.Xml.Serialization”......
Post your comment