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 7895523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:39:51+00:00 2026-06-03T07:39:51+00:00

I am unable to test my log4net library using nunit. I read the search

  • 0

I am unable to test my log4net library using nunit. I read the search results returned by Google but could not understand them.

This is the error that I am getting.

System.IO.FileNotFoundException : Could not load file or assembly
‘log4net, Version=1.2.10.0, Culture=neutral,
PublicKeyToken=692fbea5521e1304’ or one of its dependencies. The
system cannot find the file specified.

In my nunit test project I have added the reference to correct log4net dll that rest of the projects are using and added the configuration files but no luck.

My Console application and test web application that use the log4net libaray are working correctly.

I seem to only have problem with log4net nunit test project.

How can I get started with simple nunit test involving log4net library.

  • 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-06-03T07:39:52+00:00Added an answer on June 3, 2026 at 7:39 am

    You should be accepting an ILog in whatever you’re trying to test. Then you should mock it and pass it to whatever you’re attempting to test. The version of log4net shouldn’t matter at all. Your tests shouldn’t even know log4net exists.

    Using Rhinomocks, this would be:

    MockRepository mocks = new MockRepository();
    ILog mockLog = mocks.DynamicMock<ILog>();
    

    Alternatively you could go with a stub:

    ILog mockLog = MockRepository.GenerateStub<ILog>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to test my app on a device but am unable to
I'm currently working on some geolocation javascripts, but am unable to test and debug
I am unable to use Google Test's ASSERT_THROW() macro in combination with multiple template
sorry but Im unable to understand these example. I started learning ajax right from
I know it seems trivial to test, but currently I'm unable to access my
I'm unable to adjust java logging's logging level. I'm using maven surefire (mvn test),
I´m writing an application to test a library. It compiles perfectly but when I
Apparently, NSFileManager is unable to delete files created by mkstemp() . Here's some test
Error: Unable to read data from the transport connection: A blocking operation was interrupted
I am unable to read the body of a post to my grails controller.

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.