locked
web.config file section replacement to REMOVE a section? RRS feed

  • Question

  • User-744148525 posted

    Is it possible to use web.config file section replacement to remove a section or replace a section with nothing?  In my one web.config configuration I want to replace system.web/sessionState but in another I want no system.web/sessionState at all. Is this possbile with web.config section replacement or do I need to do it another way.

     

    A bit of background - in one deployment this application is an application (vdir) within IIS but in another it sits below another application hosted through cassini - for those who are interested it is the cassini implamentation for CRM offline.

    Monday, March 30, 2009 5:28 PM

Answers

  • User372121194 posted

    Hi,

    From your description, I understand that you want to change the web.config's content between different environments, such as development and deployment.  If I have misunderstood you, please feel free to let me know.

    In this case, you can use Web Deployment project which allows you to create pluggable configuration files with MSBuild task called ReplaceConfigSections. This feature allows you to specify the contents of a particular configuration section based on solution configurations.

    For more information, see http://msdn.microsoft.com/en-us/library/aa479568.aspx (Deployment Page) and http://msdn.microsoft.com/en-us/magazine/cc163448.aspx (Section: Pluggable Configuration Files).

     

    I look forward to receiving your test results.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 2, 2009 4:59 AM