开发者

ASP.NET: Web.config: Include XML element only in Release mode?

开发者 https://www.devze.com 2023-03-25 01:04 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号