You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by smdenis <sd...@hotmail.com> on 2008/07/30 05:37:12 UTC

NUnit + Log4Net Config Error

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.

-- 
View this message in context: http://www.nabble.com/NUnit-%2B-Log4Net-Config-Error-tp18725592p18725592.html
Sent from the Log4net - Users mailing list archive at Nabble.com.