Do you remember the old TreatAs registry setting for COM classes? If you want a quick refresher, check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/html/1d7a1677-738a-4258-9afc-e77bd0dcf40f.asp.
Well, TypeForwardedTo attribute is kind of like that… You use the TypeForwardedToAttribute attribute to move a type from one assembly to another without disrupting callers that compiled against the old assembly. This allows you to reorganize your libraries without breaking compatibility with applications using them.
Bill Bozeman has a good explanation of it with a code sample at http://www.bozemanblog.com/PermaLink,guid,2e6d7675-eb43-438f-8b93-9155ca1712fa.aspx.
To summarize the steps, here is what you need to do:
- Create a new assembly
- Move the class from the old assembly to the new. Make sure to keep same namespace.
- Remove the class from the old assembly.
- In the old assembly, add a reference to the new assembly.
- Add [assembly: TypeForwardedTo(typeof(YourClassName))] to the old assembly
- Recompile and redeploy both assemblies