miércoles, 17 de junio de 2009

error creating the configuration section handler for dataConfiguration

Hola a todos,

Hace tiempo que no escribo ningún post y retomo el blog con este error con la Enterprise Library 4.1 que ha hecho que me tire una horita intentando solucionarlo:
"An error occurred creating the configuration section handler for dataConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

Gracias al siguiente post (http://blogs.msdn.com/tomholl/archive/2007/04/19/avoiding-configuration-pitfalls-with-incompatible-copies-of-enterprise-library.aspx) he encontrado el motivo del error y su correspondiente solución.

Cuando en el App.config nos vamos a la clave "<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />" vemos que hay una PublicKey Token y un número que no coincide con la con el registrado en mi máquina.

Solución: Poner PublicKeyToken=null y listo.

A grandes malas, grandes remedios

Salu2

No hay comentarios: