我有我的驗證配置存儲在我的業務對象項目中的validation.config中。配置文件設置爲複製,如果更新Enterprise Library 5:如何配置FileConfigurationSource相對於asp.net web應用程序文件夾?
業務對象項目被我的Web項目引用,因此,validation.config將複製到我的Web應用程序的bin文件夾中。
在我的web.config我有驗證配置重定向:
<enterpriseLibrary.ConfigurationSource selectedSource="System Configuration Source">
<sources>
<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" />
</sources>
<redirectSections>
<add sourceName="ValidationConfigurationSource" name="validation" />
</redirectSections>
但是,使用procmon中我可以看到它正試圖從C加載配置:\ WINDOWS \ SYSTEM32 \ BIN \ validation.config
FileConfigurationSource的源似乎沒有任何關於使用AppDomain.CurrentDomain.BaseDirectory創建路徑的內容,所以我不確定相對路徑如何與asp.net一起工作
我怎樣才能得到這個工作的ASP.NET應用程序?
我在XP上使用本地IIS服務器以調試模式啓動時運行。
編輯
對不起,只是意識到有申請這兩個開放的問題:
http://entlib.codeplex.com/workitem/26990
http://entlib.codeplex.com/workitem/26760
如果我想出了一個解決辦法,我會張貼在這裏。
我相信此問題已在位於此處的Entlib 5可選更新1中得到糾正:http://www.microsoft.com/download/en/details.aspx?id=6836 – 2011-09-28 17:23:43