icelava.net

why be normal?
Welcome to icelava.net Sign in | Help

Error WDP00002: missing section system.net

  •  10-16-2007, 14:04

    Error WDP00002: missing section system.net

    So today, or last night rather, I finally got down to seriously look at this wonder trinket the ASP.NET team provided as a cool add-in project for Visual Studio - Web Deployment Projects. The one true feature that really had me excited was the ability to define multiple sections in web.config as replaceable, so different builds for different environments is possible from a single project-control point. Have staging, UAT, production environments? Just define the sections that need to be replaced with the contents of a replacement file carrying environment-specific configuration settings. Sweet.

    However, savouring this delicious taste proved to be highly elusive. Initially I was confused where to locate these replacement files. Do I place them in the WDP project's own directory? There weren't any clear instructions or information about this, so it took me awhile to figure out it had to be placed in a sub-directory in the source web site. Technically, these files can reside in the web site document root but that just makes that area messy. So having nailed that issue down I went about the business of defining all sections that ought to go through facelifts.

    appSettings=Configs\appSettings.dev.config;
    connectionStrings=Configs\connectionStrings.dev.config;
    system.web/authentication=Configs\authentication.dev.config;
    system.web/membership=Configs\membership.dev.config;
    system.net=Configs\system.net.dev.config;

    All goes through except the last entry. <system.net> despite being right there in the config file is met with a lost Visual Studio complaining of the subject-mentioned error message. I tried many things, even narrowing down to

    system.net/mailSettings=Configs\mailSettings.dev.config;

    but it still wouldn't give me joy. Apparently few people use WDPs to configure <system.net> settings and I kept digging out the same threads of other people's similar problems. And no real answer. It wasn't until I decided to throw a tantrum and watch some anime did I then gave it a more thoughtful read over this thread that made me take a look at C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config out of random curiosity. Seemingly, WDP does not like replacing section groups.

    And there it stood:

    <sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <
    section name="authenticationModules" type="System.Net.Configuration.AuthenticationModulesSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <
    section name="connectionManagement" type="System.Net.Configuration.ConnectionManagementSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <
    section name="defaultProxy" type="System.Net.Configuration.DefaultProxySection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <
    sectionGroup name="mailSettings" type="System.Net.Configuration.MailSettingsSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <
    section name="smtp" type="System.Net.Configuration.SmtpSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </
    sectionGroup>

    <mailSettings> is a section group itself. One would have to drill down to the <smtp> section to make a proper replacement.

    system.net/mailSettings/smtp=Configs\mailSettings.dev.config;

     

View Complete Thread
Powered by Community Server, by Telligent Systems