在我的web.config,<system.web>
下,我有:ASP.NET web配置文件?
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="Cache60Seconds"
location="ServerAndClient"
duration="60"
varyByParam=""
/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
在此的.config的調試版本,Web.Debug.config,我想配置文件 「Cache60Seconds」 的duration
變爲0。
換句話說,當我開發時,我想讓「Cache60Seconds」的持續時間爲0,所以它永遠不會緩存,並且當我釋放產品時,我希望持續時間變爲60秒。我該怎麼做呢?
請檢查此鏈接是否真的有幫助http://frejnorling.wordpress.com/2011/05/15/automatically-create-different-web-config-files-for-debug-and-release-builds-in -visual-studio-2010/http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspx –