我有appSettings,我想在多個Web應用程序之間共享。所以在我的解決方案的根級,我創建了一個文件夾「Common ConfigSettings」。在這裏,我有 所有共享的appSettings。然後在不同的Web項目,我添加了一個鏈接到該文件,並引用像普通設置..web.config轉換 - appSettings節點不轉換
<appSettings file="../../Common ConfigSettings/sharedAppSettings.config">
這是運作良好,而調試。現在,當我需要發佈時,「鏈接」文件被複制到相關Web項目的目錄中,因此文件路徑需要立即更改,以指向與項目web.config相同的目錄。但我無法實現轉換。
我想轉換我的web.Config中的appSettings的「文件」屬性。但ID似乎並沒有工作。
原來的web.config
<appSettings file="../../Common ConfigSettings/sharedAppSettings.config">
</appSettings>
變換
<appSettings file="sharedAppSettings.config" xdt:Transform="SetAttributes(file)"
</appSettings>
然後當我點擊預覽變換
<appSettings file="../../Common ConfigSettings/sharedAppSettings.config">
</appSettings>
給你的問題一個有意義的描述性標題,請。 – abatishchev 2013-03-07 09:01:29