Skip to content

Provide path of expected .config file in error message #227

@FrankNuessle

Description

@FrankNuessle

With log4net version 3.0.3:
I got the message:
"log4net:ERROR Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the and elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />"

It would be helpful to have the name + absolute path of "application's .config file" which is used by log4net, in the above error message of log4net.

Background:
When I'm running my unit tests with "dotnet test ..." I got the above error message and I analyzed and wonder, what's wrong with my AssemblyName.Test.dll.config.
I had to spend some effort and used then
log4net.Util.LogLog.InternalDebugging = true;
to find out, that when running
"dotnet test ..." for TFM = net8.0, the expected config file was "testhost.dll.config"!
If this information would be displayed in the above error message, I (and possibly other users) could save a lot of time.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions