問題點:網站加入 Web.config 後,Visual Studio會自動產生對應的組態設定檔(Web.Debug.config / Web.Release.config) 但是實際建置時卻只使用 Web.config ,而沒有使用到這些 web.(configuration).config 設定檔。

如上圖。
解決方法:
我上次使用了 SlowCheetah ,但是這次使用它卻失敗了。
所以我這次參考了 ( 如何在 debug 時使用對應組態設定的 web.config ) 直接修改了.vbproj ,結果成功了。
以下是我加上的XML區塊:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(MSBuildToolsVersion)\WebApplications\Microsoft.WebApplication.targets" />
<Target Name="BeforeBuild">
<TransformXml Source="Web.config" Transform="Web.$(Configuration).config" Destination="Web.config" />
</Target>
我看來這是滿好用的設定,於此分享。