views:

63

answers:

2

Hi,

I need to resolve an assembly and type at runtime and I need to find the fully qualified type name. For some reason I cannot get it right, as I keep get an exception saying it cannot find the type specified.

The app.config file, in which the assembly to look for is defined, looks like this:

<configSections>
    <section name="modules" type="Microsoft.Practices.Composite.Modularity.ModulesConfigurationSection, Microsoft.Practices.Composite"/>
  </configSections>
  <modules>
    <module assemblyFile="G:\Data\Visual Studio 2008\Projects\Race Management System.Shell\ConfigurationModularity\bin\Debug\Modules\Driver.Data.Module.dll" moduleType="Driver.Data.Module.DriverDataModule, DriverDataModule" moduleName="Driver.Data.Module.DriverDataModule"></module>
  </modules>

The assembly is called: Driver.Data.Module Namespace in assembly is: Driver.Data.Module and type name is: DriverDataModule, and this is also the name of the .cs file.

I cannot seem to find how to specify the name correctly in the xml file. Can somebody help me with the fully qualified type name?

This is for a Composite WPF application.

Thanx!

+3  A: 

Try Driver.Data.Module.DriverDataModule, Driver.Data.Module.

You can also find the full assembly-qualified name of your type by instantiating an object of that type and examining the AssemblyQualifiedName property of its Type:

DriverDataModule module = new DriverDataModule();
string fullyQualifiedName = module.GetType().AssemblyQualifiedName;
Anna Lear
A: 

What error do you get? If you're having a hard time getting a full error message out of the app, and you think your app is having problems loading the assembly itself, you can use the fuslogvw tool to log full details to disk.

It's worth also opening the assembly in Reflector to double-check the assembly's full name (displayed on the bottom-left of the window when you open Reflector), and to check that the type is in fact defined in the namespace you think it is.

Tim Robinson