ASP.NET: Web.config: Include XML element only in Release mode?
I have an ASP.NET MVC 3 web application. The .config file is listed as "Web.config" under the project root, with a "Web.Debug.config" and "Web.Release.config" as child files in the tree listing.
When the site is published in Release mode, I wanted the Web.config to contain this config under the document root, <configuraton>:
<system.runtime.caching>
<memoryCache>
<namedCaches>
<add name="Default"
cacheMemoryLimitMegabytes="0"
开发者_Go百科 physicalMemoryLimitPercentage="0"
pollingInterval="00:02:00"
/>
</namedCaches>
</memoryCache>
</system.runtime.caching>
When it's built in Debug mode, I don't want this config appearing in the Web.config.
How do I modify these three files--Web.config, Web.Release.config, and Web.Debug.config, to accomplish this?
Web.Debug.config and Web.Release.config aren't actually config files, they're xslt files that are used to "transform" your Web.Config.
This is explained in more detail Here
加载中,请稍侯......
精彩评论