Unable to cast object of type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings' to type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings'.

Topics: Validation Application Block
May 17, 2007 at 1:57 PM
Hello, I have in the GAC this Assembly 'Microsoft.Practices.EnterpriseLibrary.Data

and this is my web.config file

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="validation" type="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationSettings, Microsoft.Practices.EnterpriseLibrary.Validation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<validation>
<type assemblyName="LibPruebaEL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
name="Avansoft.Cifin2.BusinessObjects.Perfil">
<ruleset name="Regla">
<properties>
<property name="DSPerfil">
<validator lowerBound="1" lowerBoundType="Ignore" upperBound="3"
upperBoundType="Inclusive" negated="false" messageTemplate="Máximo 3 carácteres."
messageTemplateResourceName="" messageTemplateResourceType=""
tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="String Length Validator" />
</property>
</properties>
</ruleset>
</type>
</validation>
<dataConfiguration defaultDatabase="SqlCn" />
<connectionStrings>
<add name="SqlCn" connectionString="Database=pruebas;Server=ESTACION93;User Id=pruebas; Password=pruebas"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>


What happens with that error
May 17, 2007 at 2:00 PM
If I remove this part it works
, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

of course it works because it must be taking the assmbly from the bin directory and not from the GAC. But I want to use everything from the GAC.