Hi,
I created a unity Dependency Injection project. Created a constructor in app config. The error thrown as "Unrecognized element 'constructor'. Please help me on this. Thank you.
="1.0"
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration"/>
<section name="unity1" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration"/>
</configSections>
<unity>
<containers>
<container>
<types>
<type type="Sample1.IDB,Sample1" mapTo="Sample1.oracle,Sample1" name="Oracle"> </type>
<type type="Sample1.IDB,Sample1" mapTo="Sample1.sql,Sample1" name="Sql"></type>
<type type="Sample1.IDB,Sample1" mapTo="Sample1.oracle,Sample1" name="parOracle">
<constructor>
<param name="status" value="oracle" parameterType="System.String"/>
</constructor>
</type>
<type type="Sample1.IDB,Sample1" mapTo="Sample1.sql,Sample1" name="parSql">
<constructor>
<param name="status" value="sql" parameterType="System.String"/>
</constructor>
</type>
</types>
</container>
</containers>
</unity>
<appSettings>
<add key="Types" value="Oracle" />
</appSettings>
</configuration>
IUnityContainer container = new UnityContainer();
UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
here its throwing error as "Unrecognized element 'constructor'.
In app config I changed the Types to register. Then its throwing error as "Unrecognized element 'register'. Its working normaly in Types and Type. But after adding the constructor throwing an error.
Actual error is Unrecognized element 'constructor'. (D:\Sample1\Sample1\Sample1\bin\Debug\Sample1.vshost.exe.Config line 14)