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

  • Home
  • SEARCH
  • 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 745529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:35:37+00:00 2026-05-14T09:35:37+00:00

I am using log4net during my development, as as part of a project constraint,

  • 0

I am using log4net during my development, as as part of a project constraint, I now need to add it to the Global Assembly Cache.

The logging definitions are in a file Log4Net.xml. That file is referenced in my assemblyinfo as: [assembly: log4net.Config.XmlConfigurator(ConfigFile = “Log4Net.xml”, Watch = true)]. So long as the xml file was in the same directory as the log4net.dll, everything has been working fine.

However now that I’ve added log4net to the GAC, it is no longer picking up the xml file.

Does anyone know what I need to change in order to have it pick up the XML file again? Is hardcoding the patch in the assembly reference the only way?

Many thanks

  • 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-14T09:35:38+00:00Added an answer on May 14, 2026 at 9:35 am

    You might ensure that your log4net.xml file is set to “Copy Always” (Right Click on log4net.xml -> Properties -> Copy to Output Directory = Copy always). To ensure that your config file is being copied, you should check your bin\debug or bin\release directory and verify that the log4net.xml file exists in the same directory that your application executes.

    If that doesn’t workthen you can try enabling internal debugging in log4net. To enable internal debugging, add the following key to your app.config file. This will send internal log4net debug messages to your Visual Studio Output window (View -> Output).

    <configuration>
      <appSettings>
        <add key="log4net.Internal.Debug" value="true"/>
      </appSettings>
    </configuration>
    

    For more information on log4net’s internal debugging, you might check Phil Haack’s blog post here.

    If all else fails, you can turn on internal debugging and explicitly load the configuration by calling log4net’s XmlConfigurator.ConfigureAndWatch method.

    var fi = new FileInfo(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\log4net.xml");
    XmlConfigurator.ConfigureAndWatch(fi);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Backstory: I'm using log4net to handle all logging for a project I'm working on.
I'm thinking about using log4net in a MOSS(SharePoint) 2007 project, but I need to
I'm using log4net to log write log message to a rolling log file. Now
I'm investigating the differences between using log4net and System.Diagnostics.Trace for logging, and I'm curious
I'm using log4net in my project and there is one problem. The major function
I'm using log4net with .NET Common.Logging . I configured a message pattern to include
I want to Implement Logging future using log4net for my asp.net mvc application.. Can
I am using Log4Net with the AdoNetAppender to log messages from a simple systray
I'm doing some research into using log4net, and I found the IObjectRenderer interface interesting.
I'm wondering if anyone has any experience using log4net in a multi-threaded environment like

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.