Allow you to move a type from one assembly (assembly A) into another assembly (assembly B), and to do so in a way that it is not necessary to recompile clients that consume assembly A. Type forwarding works only for components referenced by existing applications. When you rebuild an application, there must be appropriate assembly references for any types used in the application.
There are four steps to forwarding a type:
- Move the source code for the type from the original assembly to the destination assembly.
- In the assembly where the type used was located, add a TypeForwardedToAttribute for the type that was moved.
- Compile the assembly that now contains the type.
- Recompile the assembly where the type used to be located, with a reference to the assembly that now contains the type.
Attribute declaration on the type being forwarded should look like the following
[assembly:TypeForwardedToAttribute(typeof(Example))]
No comments:
Post a Comment