Validation by external file - entlib 6

Topics: Validation Application Block
Aug 14, 2013 at 10:10 AM
Hi,
I have SLN that contains WebSite (MVC 4) and Class Liberary BL.
The Validations are in BL, the object to validate sent from the Controller.
I wish to Configure Validation in external file - entlib.config, who created by entlib console.
I'm trying to create a reference between the Web.config to entlib.config

I mean, I do not know where to put the entlib.config, That the Web.config will recognize.
I tried to place it in the BIN directory of the WEB SITE, but it did not help.
I tried to place it in the WEB.CONFIG - same thing

any Idea?

Web.config:
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source" parentSource="">
<sources>
  <add name="File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="EntLib.config" />
</sources>
</enterpriseLibrary.ConfigurationSource>

...
...
...
Aug 15, 2013 at 3:27 AM
There is an issue in Enterprise Library 5 with relative paths and FileConfigurationSource: http://entlib.codeplex.com/workitem/26760 .

The issue was resolved in Enterprise Library 5 Optional Update 1 (version 5.0.505.0). So, the solution is to upgrade to that version or to use an absolute file path (or to use one of the workarounds suggested in the issue comments).

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Aug 15, 2013 at 6:41 AM
Hi Randy.
Thanks your reply.
I work with entlib6, and this is the answer :

Have a nice day.
Odelia.

---------- Forwarded message ----------