Given the following class declarations in the non-prime module of a
multi-module assembly:
public class Outer {
public class Middle {
public class Inner {
}
}
}
Given the following reference in an assembly that references the
multi-module assembly containing the above declaration:
class App {
static void Main () {
Outer.Middle.Inner a = new Outer.Middle.Inner();
}
}
The metadata looks like this:
Client assembly Dependent assembly
=========================== ============================
TypeRef ResolutionScope ExportedType Implementation
--------------------------- ----------------------------
Outer AssemblyRef --------> Outer File ------------>
Non-prime module
^ ^
| |
----------------- -------------------------
| |
Middle TypeRef - Middle ExportedType -
^ ^
| |
----------------- -------------------------
| |
Inner TypeRef - Inner ExportedType -
Why are there ExportedType entries for Inner and Middle? There is no way
to reference such entries as each class is a nested class.
To put it another way, to bind a reference to "Inner", you must follow
the TypeRef's until you location the top-level containing type, then
bind to the assembly containing the top-level type, then bind to the
module containing the top-level type. Now I have the TypeDef for the
top-level type so I can find the TypeDef for "Middle" in "Inner", then
find the TypeDef for "Inner" in "Middle" in "Outer".
I don't seem to need the ExportedType definitions for nested types. What
am I not understanding?
-- Brent Rector, .NET Wise Owl
Demeanor for .NET - an obfuscation utility
http://www.wiseowl.com/Products/Products.aspx
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.