I'm currently writing a custom forms application that allows a user to design a data capture form. I store the field's ControlType and ControlAssembly in the database and then create them on the forms at runtime.
For example:
ControlType = `System.Web.UI.WebControls.TextBox`.
ControlAssembly= `System.Web`.
So I can therefor create a fully qualified name and create the control doing the following:
string target = Assembly.CreateQualifiedName("System.Web", field.ControlType);
Type type = Type.GetType(target);
Control control = Activator.CreateInstance(type) as Control;
But, this will cause an error as "System.Web" is not a valid assembly name. The assembly name itself has to be fully qualified, i.e. System.Web.Extensions would be:
"System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"
Is there any way I can get the fully qualified name of the assembly System.Web without having to store the entirity of the version, culture and PKT?