1
votes

I am trying to register a type conversion in my config file as follows:

<param name="connectionString" parameterType="System.String">
    <value value="MyDbConnection" 
        type="System.Configuration.ConnectionStringSettings" 
        typeConverter="ConnectionStringSettingsTypeConverter" />
</param>

I am getting the standard can't load type error

Could not load type 'System.Configuration.ConnectionStringSettings' from assembly 'Microsoft.Practices.Unity.Configuration, ...etc

Why is it trying to load the type from the Unity assembly? What do I need to add for Unity to locate the correct assembly?

I thought because I was using the fully qualified name, it should just work.

Edit: note I am using version 1.2. The 2.0 version has an tag in the schema, but 1.2 doesn't seem to have this tag.

1

1 Answers

2
votes

You're not using the really fully qualified type name - you need to provide the assembly name as well. Try this:

type="System.Configuration.ConnectionStringSettings,System.Configuration"