How to configure FileConfigurationSource relative to web application folder?

Topics: Enterprise Library Core
Jun 29, 2010 at 5:13 PM

I have my validation configuration stored in validation.config in my Business Object project.  The config file is set to copy if newer

The business object project is referenced by my web project, therefore, the validation.config copies to the bin folder of my we application.

In my web.config I have the validation configuration redirected:


  <enterpriseLibrary.ConfigurationSource selectedSource="System Configuration Source">
      <add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="ValidationConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        filePath="bin\validation.config" />
      <add sourceName="ValidationConfigurationSource" name="validation" />


However, using procmon I can see it is trying to load the configuration from C:\WINDOWS\system32\bin\validation.config

The source for the FileConfigurationSource doesn't seem to have anything in it about creating a path using AppDomain.CurrentDomain.BaseDirectory so I'm not sure how relative paths can work with

How can I get this to work for an ASP.NET application?  

I am running on XP using the local IIS server launching in debug mode.


Jun 29, 2010 at 6:54 PM

I should have specified that I am using entlib 5

Jul 1, 2010 at 2:04 AM

Hi rcollette, this is actually logged in the Issue Tracker, click here to view the workitem.  Currently, the only workaround is to modify the source code.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.