applicationSettings and Web.config

Posted by Eric J. on Stack Overflow See other posts from Stack Overflow or by Eric J.
Published on 2010-05-25T16:14:13Z Indexed on 2010/05/25 16:21 UTC
Read the original article Hit count: 1038

Filed under:
|

I have a DLL that provides logging that I use for WebForms projects and now wish to use it in an ASP.Net MVC 2 project.

Some aspects of that DLL are configured in app.config:

<configuration>
    <configSections>
            <section name="Tools.Instrumentation.Properties.Settings" 
                     type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
                     requirePermission="false" />
        </sectionGroup>
    </configSections>

 <applicationSettings>
        <Tools.Instrumentation.Properties.Settings>
            <setting name="LogLevel" serializeAs="String">
                <value>DEBUG</value>
            </setting>
            <setting name="AppName" serializeAs="String">
                <value>MyApp</value>
            </setting>
            <setting name="Port" serializeAs="String">
                <!--value>33333</value-->
                <value>0</value>
            </setting>
        </Tools.Instrumentation.Properties.Settings>
    </configuration>    

However, when I create a similar entry in Web.config, I get the error:

Unrecognized configuration section applicationSettings

My two-part question:

  • How do I make this config entry work in Web.config?
  • Where can I read up on the conceptual differences between WinForms configuration and ASP.Net configuration?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about web-config