Kevin,
Neither is strong named.
You may have been confused by my example because, well, the way the Framework handles calls to IDesignerHost.GetType() is pretty
confusing!
To enlarge upon my earlier example:
ProjectA (assembly name AssemblyA):
ComponentA
ProjectB (assembly name AssemblyB):
references ProjectA
ComponentB
CustomDesignerB (for ComponentB)
Within CustomDesignerB, you would expect to have to call IDesignerHost.GetType("ProjectA.ComponentA, AssemblyA") in order to create
a Type representing ProjectA.ComponentA.
Calling IDesignerHost.GetType("ProjectA.ComponentA") works just as well. In fact, from a little bit of testing it appears that you
never have to specify the assembly in the IDesignerHost.GetType() call, provided the Type you're creating is defined in an assembly
referenced in ProjectB.
That's sort of understandable: whatever routine searches for the metadata used to create a Type probably starts by looking in the
current project (ProjectB, in my example) and the assemblies it references.
But what's really weird is that IDesignerHost.GetType("ProjectA.ComponentA, AssemblyB") works just as well. Apparently, if the
metadata search can find the information it needs from the Type name, minus the assembly add-on, it ignores the assembly add-on.
I discovered this by accident; I meant to do the call as IDesignerHost.GetType("ProjectA.ComponentA, AssemblyA"), but goofed up.
At this point my main interest is in understanding how IDesignerHost.GetType() does its work, since it looks like what I need, but
the documentation on it is pretty sparse. I like that it can create Types at design-time which are defined in the source code of the
project I'm building (I need that capability in some of my custom designers and UITypeEditors). But I'd like to know more details,
so I can see if it may cause some problems for me down the road.
Do you have access to any information on the "guts" of how IDesignerHost.GetType() works, and how it differs from Type.GetType()?
They do behave differently!
In my example, calling Type.GetType("ProjectA.ComponentA, AssemblyA") or Type.GetType("ProjectA.ComponentA") within CustomDesignerB
returns a null...unless you first call IDesignerHost.GetType(), after which Type.GetType() works just fine. I presume that means
IDesignerHost.GetType() is loading metadata from the current project someplace where Type.GetType() can access it, but that
Type.GetType() isn't smart enough to do that load itself.
- Mark