NUnit + Log4Net Config Error

View: New views
1 Messages — Rating Filter:   Alert me  

NUnit + Log4Net Config Error

by smdenis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When I compile my website using Visual Web Developer, it builds with no problems. I created the DLL using the aspnet_compiler on the command line and send that to NUnit. When I try to run my unit tests, I keep getting this error:

log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

Here's snippet from my web.config file:

<configSections>
    <!-- Configure Log4Net-->
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
                <!-- Configure NHibernate -->
                <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
               
                <!-- Configure UrlRewriter -->
                <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
        </configSections>
        <!-- NHibernate settings-->
        <nhibernate configSource="config\nhibernate.xml"/>
        <!-- Log4Net Settings -->
  <log4net configSource="config\log4net.xml">
  </log4net>

Every solution I've seen on other forums says to add something to the AssemblyInfo.cs, but since my project is a website, I don't have it.

I've tried everything, but I can't seem the figure out what the cause of this error is. Please help.