views:

73

answers:

0

I have a custom server control for asp.net. One of the properties available to it is a generic object. That generic object has custom attributes that are read and used to customize the rendering of the control.

At run time, this is no problem, since all I need to do is find all the attributes on the instance that gets passed into the control.

However, just as the "DataSource" member of controls can call up a list of object types at design time, I would like to be able to bring up a list of types in the host assembly. There is no need for actual instances, since I'm rendering based on attributes.

This is an example property from the host control:

[Browsable(true)]
[TypeConverter(typeof(TheObjectConverter))]
public object TheObject
{
    get { return _theObject; }
    set { SetTheObject(value); }
}

What I want to have happen is to have TheObjectConverter be able to load the assembly of the host page for the control.

None of the following seem to work

.GetReferencedAssemblies();
.GetExecutingAssembly();
.GetCallingAssembly();
.GetEntryAssembly();
.GetAssembly();

I even a full recursion against .GetReferencedAssemblies(), with no luck. It seems I am unable to load the assembly of the control's host at design time. Is that correct, or is there a way to do this?