EntLib 4.1: Validation Application Block - Could not load file or assembly

Topics: Validation Application Block
Nov 16, 2009 at 11:45 AM

Hi,

I'm using Enterprise Library 4.1 Validation Application Block for validating my WindowsForms project. I am very tired struggling why the following error shows up. Please share with me if anyone have any idea about this problem?

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Below is the stack Trace:

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)
   at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType)
   at System.Reflection.RuntimePropertyInfo.GetCustomAttributes(Type attributeType, Boolean inherit)
   at Microsoft.Practices.EnterpriseLibrary.Validation.ValidationReflectionHelper.ExtractValidationAttribute[T](ICustomAttributeProvider attributeProvider, String ruleset)
   at Microsoft.Practices.EnterpriseLibrary.Validation.MetadataValidatedElement.UpdateFlyweight(MemberInfo memberInfo, Type targetType)
   at Microsoft.Practices.EnterpriseLibrary.Validation.MetadataValidatedElement.UpdateFlyweight(PropertyInfo propertyInfo)
   at Microsoft.Practices.EnterpriseLibrary.Validation.MetadataValidatedElement..ctor(PropertyInfo propertyInfo, String ruleset)
   at Microsoft.Practices.EnterpriseLibrary.Validation.MetadataValidatorBuilder.CreateValidatorForProperty(PropertyInfo propertyInfo, String ruleset)
   at Microsoft.Practices.EnterpriseLibrary.Validation.PropertyValidationFactory.GetPropertyValidatorFromAttributes(Type type, PropertyInfo propertyInfo, String ruleset, MemberAccessValidatorBuilderFactory memberAccessValidatorBuilderFactory)
   at Microsoft.Practices.EnterpriseLibrary.Validation.PropertyValidationFactory.GetPropertyValidator(Type type, PropertyInfo propertyInfo, String ruleset, MemberAccessValidatorBuilderFactory memberAccessValidatorBuilderFactory)
   at Microsoft.Practices.EnterpriseLibrary.Validation.PropertyValidationFactory.GetPropertyValidator(Type type, PropertyInfo propertyInfo, String ruleset, ValidationSpecificationSource validationSpecificationSource, MemberAccessValidatorBuilderFactory memberAccessValidatorBuilderFactory)
   at Microsoft.Practices.EnterpriseLibrary.Validation.PropertyValidationFactory.GetPropertyValidator(Type type, PropertyInfo propertyInfo, String ruleset, ValidationSpecificationSource validationSpecificationSource, MemberValueAccessBuilder memberValueAccessBuilder)
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.ValidationIntegrationHelper.GetValidator()
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidatedControlItem.get_Validator()
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidationProvider.PerformValidation(ValidatedControlItem validatedControlItem)
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidatedControlItem.OnValidating(Object source, CancelEventArgs e)
   at System.ComponentModel.CancelEventHandler.Invoke(Object sender, CancelEventArgs e)
   at System.Windows.Forms.Control.OnValidating(CancelEventArgs e)
   at System.Windows.Forms.Control.NotifyValidating()
   at System.Windows.Forms.Control.PerformControlValidation(Boolean bulkValidation)
   at System.Windows.Forms.ContainerControl.ValidateThroughAncestor(Control ancestorControl, Boolean preventFocusChangeOnError)
   at System.Windows.Forms.ContainerControl.EnterValidation(Control enterControl)
   at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
   at System.Windows.Forms.ContainerControl.AssignActiveControlInternal(Control value)
   at System.Windows.Forms.ContainerControl.ActivateControlInternal(Control control, Boolean originator)
   at System.Windows.Forms.ContainerControl.ActivateControlInternal(Control control)
   at System.Windows.Forms.Control.WmSetFocus(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at ComponentFactory.Krypton.Toolkit.KryptonTextBox.a.a(Message& A_0)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SetFocus(HandleRef hWnd)
   at System.Windows.Forms.Control.FocusInternal()
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at ComponentFactory.Krypton.Toolkit.KryptonTextBox.a.a(Message& A_0)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at IPA.DataProcessing.IPAProgram.Main() in E:\IPA\Research And Development\Venu\2.2.1.0.1\ActiveSource\IPAProgram.cs:line 51

 

Thank you,

Venu.

Nov 16, 2009 at 1:34 PM

Hi,

What are the assemblies are you referencing? Is it the one's from the installation folder? usually from C:\Program Files\Microsoft Enterprise Library 4.1 - October 2008\Bin . Please see this FAQ item: http://entlib.codeplex.com/wikipage?title=Why%20am%20I%20getting%20the%20messages%2c%20%22Could%20not%20load%20file%20or%20assembly%22&referringTitle=EntLib%20FAQ

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Nov 17, 2009 at 5:40 AM

Hi,

Initially, I was referencing the assemblies from the D:\EntLib41Src\bin folder. Now I'm referencing the same from the C:\Program Files\Microsoft Enterprise Library 4.1 - October 2008\Bin folder.

But now, i am getting another familiar error... :)

The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

Below is the StackTrace for the same:

The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
   at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidationProvider.GetSourceType()
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidatedControlItem.Microsoft.Practices.EnterpriseLibrary.Validation.Integration.IValidationIntegrationProxy.get_ValidatedType()
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.ValidationIntegrationHelper..ctor(IValidationIntegrationProxy integrationProxy)
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidatedControlItem.get_Validator()
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidationProvider.PerformValidation(ValidatedControlItem validatedControlItem)
   at Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidatedControlItem.OnValidating(Object source, CancelEventArgs e)
   at System.ComponentModel.CancelEventHandler.Invoke(Object sender, CancelEventArgs e)
   at System.Windows.Forms.Control.OnValidating(CancelEventArgs e)
   at System.Windows.Forms.Control.NotifyValidating()
   at System.Windows.Forms.Control.PerformControlValidation(Boolean bulkValidation)
   at System.Windows.Forms.ContainerControl.ValidateThroughAncestor(Control ancestorControl, Boolean preventFocusChangeOnError)
   at System.Windows.Forms.ContainerControl.EnterValidation(Control enterControl)
   at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
   at System.Windows.Forms.ContainerControl.AssignActiveControlInternal(Control value)
   at System.Windows.Forms.ContainerControl.ActivateControlInternal(Control control, Boolean originator)
   at System.Windows.Forms.ContainerControl.ActivateControlInternal(Control control)
   at System.Windows.Forms.Control.WmSetFocus(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at ComponentFactory.Krypton.Toolkit.KryptonTextBox.a.a(Message& A_0)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SetFocus(HandleRef hWnd)
   at System.Windows.Forms.Control.FocusInternal()
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at ComponentFactory.Krypton.Toolkit.KryptonTextBox.a.a(Message& A_0)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at IPA.DataProcessing.IPAProgram.Main() in E:\IPA\Research And Development\Venu\2.2.1.0.1\ActiveSource\IPAProgram.cs:line 51

Thank you,

Venu.

Nov 17, 2009 at 6:17 AM

Are you editing your config manually? If yes, please try to open it using the enterprise library config tool and see if it will be able to display your config properly.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Nov 17, 2009 at 8:49 AM

Hi,

When I open the config file using Enterprise library config tool, i found the whole validation application block missing. All my validation block tags are missing in the config file.

 

Thank you,

Venu.

Nov 17, 2009 at 9:59 AM

Open it using the xml editor, your validation section should be:

<section name="validation" type="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationSettings, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

I think your PublicKeyToken may be set to null as you are previously using the unsigned binaries.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Nov 17, 2009 at 11:37 AM

Hi,

I am still getting the same error.

I have pasted the snippet of my config file for your reference.

<font size="1" color="#0000ff"><font size="1" color="#0000ff">

 

</font></font><font size="1" color="#0000ff">

 

</font>

 

 

 <configSections>
    <section name="validation" type="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationSettings, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </configSections>
  <validation>
    <type assemblyName="IPA.BusinessEntities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
      name="IPA.BusinessEntities.MandatoryInvoiceEntities">
      <ruleset name="RuleSetMandatory">
        <properties>
          <property name="RenVendorCode">
            <validator pattern="^[A-Z0-9]{4}$" options="Multiline" patternResourceName=""
              patternResourceType="" messageTemplate="Cannot be blank. Only 4-lettered upper case alphanumerics are allowed."
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RegexValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="RegexValidator" />
          </property>

 

 

 

Nov 17, 2009 at 11:49 AM

Did you try to open the config again using the config tool?  Please check the error upon opening.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Nov 17, 2009 at 11:58 AM

I opened config file using the config tool. I found no errors and it's showing all the validation block tags properly. And again i built and run the application.

But i'm getting the same error on validation of any field: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

Thank you,
Venu

 

 

 

Nov 18, 2009 at 4:20 AM

Hi,

Can you send us a copy of your config file? Or better a quick repro application.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Nov 18, 2009 at 8:44 AM
Hi,
I'm giving the 2 config files. 
1. Business Validation Layer config file
2. Application config file.
Please find below the contents of first config file. The file name is BusinessEntitiesValidation.exe.config :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="validation" type="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationSettings, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </configSections>
  <validation>
    <type assemblyName="IPA.BusinessEntities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
      name="IPA.BusinessEntities.MandatoryInvoiceEntities">
      <ruleset name="RuleSetMandatory">
        <properties>
          <property name="RenVendorCode">
            <validator pattern="^[A-Z0-9]{4}$" options="Multiline" patternResourceName=""
              patternResourceType="" messageTemplate="Cannot be blank. Only 4-lettered upper case alphanumerics are allowed."
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RegexValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="RegexValidator" />
          </property>
          <property name="RenAccountNumber">
            <validator pattern="^[A-Za-z0-9]+$" options="Multiline" patternResourceName=""
              patternResourceType="" messageTemplate="Cannot be blank. Only alphanumeric values are allowed."
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RegexValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="RegexValidator" />
          </property>
          <property name="RenInvoiceDate">
            <validator pattern="((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$))"
              options="Multiline" patternResourceName="" patternResourceType=""
              messageTemplate="Cannot be blank. Valid date format: M[M]/D[D]/YYYY. Should not be more than current system date."
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RegexValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="RegexValidator" />
          </property>
          <property name="RenCurrentCharges">
            <validator pattern="^[+-]?(?:\d+\.?\d{1,2}|\d*\.?\d{1,2}|\d)[\r\n]*$"
              options="Multiline" patternResourceName="" patternResourceType=""
              messageTemplate="Cannot be blank. Should be in a valid currency format."
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RegexValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="RegexValidator" />
          </property>
        </properties>
      </ruleset>
    </type>
    <type assemblyName="IPA.BusinessEntities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
      name="IPA.BusinessEntities.OptionalInvoiceEntities">
      <ruleset name="RuleSetOptional">
        <properties>
          <property name="BalForward">
            <validator pattern="^(^[+-]?(?:\d+\.?\d{1,2}|\d*\.?\d{1,2}|\d)[\r\n]*$)*$"
              options="Multiline" patternResourceName="" patternResourceType=""
              messageTemplate="Optional field. Should be in a valid currency format."
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RegexValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="RegexValidator" />
          </property>
          <property name="CheckDate">
            <validator pattern="^(((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$)))*$"
              options="Multiline" patternResourceName="" patternResourceType=""
              messageTemplate="Optional field. Should be in M[M]/D[D]/YYYY format."
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RegexValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="RegexValidator" />
          </property>
          <property name="CheckNum">
            <validator pattern="^[A-Za-z0-9]*$" options="Multiline" patternResourceName=""
              patternResourceType="" messageTemplate="Optional field. Only alphanumeric values are allowed."
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RegexValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="RegexValidator" />
          </property>
        </properties>
      </ruleset>
    </type>
  </validation>
  <connectionStrings>
    <add name="IPA" connectionString="Data Source=localhost; user id=ipa_dev_admin; password=admin;Initial Catalog=IPA_DEVELOPMENT;"
      providerName="System.Data.SqlClient" />
    <add name="symbol" connectionString="Data Source=localhost;User ID=symbol_dev_admin;Password=admin;Initial Catalog=SYMBOL_DEVELOPMENT;"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>
And here is the App.config file where in i have referenced the above file. 
<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="defaultCostCenters" type="System.Configuration.NameValueSectionHandler" />
    <section name="FRBNYChargeCategoryCostCenters" type="System.Configuration.NameValueSectionHandler" />
    <section name="ValidateCharacters" type="System.Configuration.NameValueSectionHandler" />
    <section name="ValidDateFormats" type="System.Configuration.NameValueSectionHandler" />
  </configSections>
  <enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source">
    <sources>
      <add name="File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="E:\IPA\Research And Development\Venu\2.2.1.0.1\IPA.BusinessEntities\BusinessEntititesValidation.exe.config" />
    </sources>
  </enterpriseLibrary.ConfigurationSource>
  <connectionStrings>
    <add name="IPA" connectionString="Data Source=localhost; user id=ipa_dev_admin; password=admin;Initial Catalog=IPA_DEVELOPMENT;" providerName="System.Data.SqlClient" />
    <add name="symbol" connectionString="Data Source=localhost;User ID=symbol_dev_admin;Password=admin;Initial Catalog=SYMBOL_DEVELOPMENT;" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <add key="RecordsPerPage" value="5" />
    <add key="LastReleaseVersion" value="2.1.0.5.9" />
    <add key="INTEGRIS" value="INTEGRIS" />
    <add key="CADBURY" value="CADBURY" />
    <add key="DELAWARE" value="DELAWARE" />
    <add key="LAQUINTA" value="LAQUINTA" />
    <add key="NEMC" value="NEMC" />
    <add key="TICKETS" value="TICKETS" />
    <add key="CONVERGEX" value="CONVERGEX" />
    <add key="MAGELLAN" value="MAGELLAN" />
    <add key="CSX" value="CSX" />
    <add key="HOUGHTON" value="HOUGHTON" />
    <add key="PFIZER" value="PFIZER" />
    <add key="INTEGRYSENERGY" value="INTEGRYSENERGY" />
    <add key="EDWARDJONES" value="EDWARDJONES" />
    <add key="KIMBERLYCLARK" value="KIMBERLYCLARK" />
    <add key="BNY" value="BNY" />
    <add key="FRBNY" value="FRBNY" />
    <add key="LogPath" value="C:\IPAExceptionLogs\" />
    <add key="Activate" value="True" />
    <add key="CurrentRelease" value="2.1.0.5.9" />
    <add key="FRBNYXFERUNCHECK" value="CKT - USG|LATE PYMT|LATE - PYMT - 4113551|CKT - USG - 4113551|LATE PYMT - 4153311|CKTS - USG - 4153311" />
    <add key="CurrentColorTheme" value="Office 2003" />
    <add key="DefaultColorTheme" value="Office 2007 - Black" />
    <add key="ClientSettingsProvider.ServiceUri" value="" />
  </appSettings>
  <!--Default Cost centers - clientwise-->
  <defaultCostCenters>
    <add key="INTEGRIS" value="Default" />
    <add key="NEMC" value="NEMC Default" />
    <add key="TICKETS" value="830" />
    <add key="MAGELLAN" value="Default Cost Center" />
    <add key="PFIZER" value="Default Cost Center" />
    <add key="INTEGRYSENERGY" value="Default" />
    <add key="EDWARDJONES" value="B99999" />
    <add key="KIMBERLYCLARK" value="0000834952" />
    <add key="BNY" value="Default" />
    <add key="FRBNY" value="DefaultCostCenter" />
  </defaultCostCenters>
  <!--End of Default Cost centers - clientwise-->
  <!--Start: Data Entry Validation for Inventory, Charge Category, Charge Amount-->
  <ValidateCharacters>
    <add key="ValidCharactersForInventory" value="[^a-zA-Z0-9 \'_ \'-]">
    </add>
    <add key="ValidCharactersForChargeCategory" value="[^a-zA-Z0-9 \'_ \'-]">
    </add>
    <add key="ValidCharactersForChargeAmount" value="^[+-]?(?:\d+\.?\d{2}|\d*\.?\d{2}|\d)[\r\n]*$">
    </add>
    <add key="InvalidCharacters" value="[|]">
    </add>
  </ValidateCharacters>
  <!--End: Data Entry Validation for Inventory, Charge Category, Charge Amount-->
  <ValidDateFormats>
    <!--DDMMYYYY format for the auto population of received date read from the file name of the scanned invoices-->
    <add key="ReceiptDateFormat" value="^(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])02((19|[2-9]\d)\d{2}))|(2902((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$">
    </add>
    <!--End-->
  </ValidDateFormats>
  <FRBNYChargeCategoryCostCenters>
    <add key="CKT - USG" value="6805" />
    <add key="LATE PYMT" value="6805" />
    <add key="LATE - PYMT - 4113551" value="6805" />
    <add key="CKT - USG - 4113551" value="6805" />
  </FRBNYChargeCategoryCostCenters>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="office" publicKeyToken="71E9BCE111E9429C" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Vbe.Interop" publicKeyToken="71E9BCE111E9429C" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.web>
    <membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
      </providers>
    </membership>
    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
      <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
      </providers>
    </roleManager>
  </system.web>
</configuration>
Thanks And Regards,
Venu.