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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:04:57+00:00 2026-05-31T17:04:57+00:00

I have used log4net in winforms before. First time using with a wpf console

  • 0

I have used log4net in winforms before. First time using with a wpf console app. The console shows up and the console appender works exactly as in the winforms app. However in winforms I never had to give the full path to the log4net xml file. It is located in the same place where all the cs files are. (the default place where VS 2010 puts all its source files. So

  XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo("log4config.xml"));

works in a winforms app’s Program.cs->main() but for the wpf version where I have my own Startup class with my own Main() (instead of the autogenerated and hidden main()) I have to change the line to look like this

  XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(@"c:\fullpath\log4config.xml"));

This took me quite a while to nail down so I thought it may be worthwhile to figure why this is so. Anyone know ? I am using log4net ver 1.2.10.0. The log4net dll and xml both have copy to local = true in winforms and wpf. thank you

  • 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-31T17:04:58+00:00Added an answer on May 31, 2026 at 5:04 pm

    The log4net dll and xml both have copy to local = true.

    That syntax applies to the log4net.dll, but for the log4config.xml file, it should have a property called ‘Copy to Output Directory’ which has options ‘Do not Copy’, ‘Copy if newer’ and ‘Copy Always’.

    When you run it, does the log4config.xml actually exist in the ..\bin\debug or ..\bin\release folder and if so, is it the correct version of the file.?

    As Shrieks has said, this is probably not a log4net issue, since log4net should be simply using the FullName property of the FileInfo object that has been created and passed to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used the XML Parser before, and even though it worked OK, I
I have been told to add logging to my code using log4net, the problem
My log4net used to work, and not sure exactly when it stopped working, but
I have used Netbeans before with Subversion (SVN), and I liked how it showed
I have used FCKeditor in my project. It worked fine before i add url
never used log4net before, but I may end up kicking myself for that... if
I have log4net implemented in a Visual Studio 2010 VB.NET Windows service. It used
I have a solution consisting of a main winforms app, with associated internally written
I have used traditional version control systems to maintain source code repositories on past
I have used IPC in Win32 code a while ago - critical sections, events,

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.