1

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.

fearofawhackplanet
  • 52,166
  • 53
  • 160
  • 253

1 Answers1

2

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"
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • I now get `Could not load file or assembly 'System.Configuration' or one of its dependencies. The system cannot find the file specified`. Exception Details: ` System.IO.FileNotFoundException: Could not load file or assembly 'System.Configuration' or one of its dependencies. The system cannot find the file specified.` on line `config.Containers.Default.Configure(_container)`. Any ideas? – fearofawhackplanet Jun 23 '10 at 11:31