Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7413685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:56:40+00:00 2026-05-29T06:56:40+00:00

We recently moved all our tests from NUnit to MsTest. We are using Spring.NET

  • 0

We recently moved all our tests from NUnit to MsTest. We are using Spring.NET for an IOC container and Log4Net. Log4Net is unable to find the log4net.xml despite having it in test project. Any ideas what it could be?

Here is the error that we are receiving:

Unable to create instance of class
OurCompany.DataAccess.DocumentManagement.Tests.EmailVerificationTokensAdapterTests.DeleteTests.
Error: Common.Logging.ConfigurationException: Unable to create
instance of type Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.
Possible explanation is lack of zero arg and single arg
NameValueCollection constructors —>
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. —>
Common.Logging.ConfigurationException: log4net configuration file
‘log4net.xml’ does not exists. at
Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter..ctor(NameValueCollection
properties)
— End of inner exception stack trace — at System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo
method, Object[] args, ref SignatureStruct signature, RuntimeType
declaringType) at
System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo
method, Object[] args, SignatureStruct signature, RuntimeType
declaringType) at
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) at System.Activator.CreateInstance(Type type,
BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo
culture, Object[] activationAttributes) at
Common.Logging.LogManager.BuildLoggerFactoryAdapter()
— End of inner exception stack trace — at Common.Logging.LogManager.BuildLoggerFactoryAdapter() at
Common.Logging.LogManager.get_Adapter() at
Spring.Testing.Microsoft.AbstractSpringContextTests..ctor() at
Spring.Testing.Microsoft.AbstractTransactionalDbProviderSpringContextTests..ctor()
at
OurCompany.Tests.Common.Domain.SATransactionalIntegrationTestsBase..ctor()
in SATransactionalIntegrationTestsBase.cs: line 19 at
OurCompany.DataAccess.DocumentManagement.Tests.EmailVerificationTokensAdapterTests.DeleteTests..ctor()
in DeleteTests.cs: line 20

Here is what we have in the config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="common">
            <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
        </sectionGroup>
    </configSections>

    <common>
        <logging>
            <factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging">
                <arg key="level" value="All" />
                <arg key="showLogName" value="true" />
                <arg key="showDataTime" value="true" />
                <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
            </factoryAdapter>
        </logging>
    </common>
</configuration>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:56:40+00:00Added an answer on May 29, 2026 at 6:56 am

    Here’s a snippet of the web.config file, here’s the steps:
    You can add a key in the appSettings that points to an external config file containing all the Log4net settings:

     <appSettings>
          <add key="log4net.Config" value="Configs\develop.config" />
      </appSettings>
    

    Here’s the external config file:

    <log4net>
      <root>
            <appender-ref ref="LogFileAppender" />
      </root>
      ...
    </log4net>
    

    While in your code you will setup the XmlConfigurator:

    Config.XmlConfigurator.Configure(New FileInfo(ConfigurationManager.AppSettings("log4net.Config")))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently moved our ASP.NET session state from InProc to a Sql Server
Recently our Web hosting provider moved to a medium trust level for all shared
I recently moved my asp.net appliaction from windows 2003 / IIS 6 to windows
I've recently moved from VB6 to VB.NET and I am finally getting there with
We've recently moved our company website to a new host. It is an ASP.NET
We just recently moved our DB from 9i to 10G (Yes..better late than never
I recently moved from Visual Basic 6 to C# 2010 .NET. In Visual Basic
Last year we moved all our new functionality to ASP.NET MVC. However we still
I recently moved my whole local web development area over to using MacPorts stuff,
We recently moved our Windows CE application to the SD Card. Since then the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.