An error occurred creating the configuration section handler for validation: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral , PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

Oct 27, 2009 at 4:40 AM
Edited Oct 27, 2009 at 4:45 AM

Hi,

I have created one .Net Class library using 3.5 framework where I have used Validation Application Block. Aftre that I have deployed this class library as COM as per project requirement.

Then in order to access config file I have used external app.config.

Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource fileConf = new Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource(@"C:\abc.exe.config");

ValidationResults vResult = ValidationFactory.CreateValidator<EbsHeader>("Rule Set_HeaderValidation", fileConf).Validate(this);

I registered the class library using regsvcs command.

But while running in the aboive mentioned lines I am getting the error,

"An error occurred creating the configuration section handler for validation: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral , PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (C:\abc.exe.config line 4)

 Please help me immediately.

 

 

Nov 28, 2009 at 4:10 PM
Edited Nov 28, 2009 at 4:10 PM

Remove the version and publickeyToken attributes from the config file entry. That worked for me. It's probably conflicting with an older version that came with an install of some sort.