none
Code to compare two web.config file RRS feed

  • General discussion

  • For the two given web.config files (these are paths to the file) we must validate that both have the same amount of entries under the AppSettings (order is irrelevant) and they have the same values on each. If one or many entries (AppSettings nodes) are either missing or different in any of the two files, an exception is to be thrown with all (not only the first mismatch) found between the two files. Remember this should only apply to AppSettings child nodes.

    Example Content

    webConfigPath1:

    <appSettings>

        <add key="FeedCacheTime" value="300" /> DIFFERENT VALUES

        <add key="FeedPageUrl" value="/_layouts/feed.aspx?" /> SAME VALUES

        <add key="AdfsProviderName" value="ADFSv2" /> MISSING VALUE ON webConfigPath2

    </appSettings>

    webConfigPath2:

    <appSettings>

        <add key="FeedCacheTime" value="400" /> DIFFERENT VALUES

        <add key="FeedPageUrl" value="/_layouts/feed.aspx?" /> SAME VALUES

        <add key="CacheAuthenticatedIndividual" value="True" /> MISSING VALUE ON webConfigPath1

    </appSettings>



    • Edited by adityadugyala Wednesday, May 22, 2013 9:22 AM
    • Moved by Bob Beauchemin Thursday, May 23, 2013 2:11 AM Moved to a more appropriate forum
    Wednesday, May 22, 2013 6:00 AM

All replies