I am preparing for MCTS 70-536, after reading this article. I am not 100% sure I understand the concept of typeforwarding. I find the steps given in the article even more confusing. Whats the deal if I am copying the sourcecode of type to be forwarded and recompiling it. What happens with old dll and the client ??
Share
Type forwarding allows you to relocate a type between assemblies. So originally it is
TypeAinAssemblyA. By applying type-forwarding, you can end withTypeAinAssemblyB.The subtlety is the code that is already compiled doesn’t see the change – they ask for the type in
AssemblyA, and the runtime silently gives them the type fromAssemblyB. This is very important if you have existing code.However; new code cannot be recompiled referencing
TypeAwithout you referencingAssemblyB.So:
AssemblyAandAssemblyBin the above exampleAssemblyB(the new one)