Comments (11)
I am on vacation, but next week I will look at again, thank you so much!
from logging-log4net.
Hi @SwEngine,
can you please be more specific?
What exact error do you get when you do what?
from logging-log4net.
I use only normal logging processes. When releasing the executable, I checked the trimming unused code option, it gives the error below,
However, when I unchecked the trimming unused code option, it does not give any error.
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String)
log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize
---> System.MissingMethodException: Cannot dynamically create an instance of type 'System.Configuration.ClientConfigurationHost'. Reason: No parameterless constructor defined.
at System.RuntimeType.ActivatorCache..ctor(RuntimeType)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean)
at System.Configuration.Internal.ConfigSystem.System.Configuration.Internal.IConfigSystem.Init(Type, Object[] )
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String)
Program::Run msg=The type initializer for 'log4net.Core.LoggerManager' threw an exception.
Unhandled exception. System.TypeInitializationException: The type initializer for 'log4net.Core.LoggerManager' threw an exception.
---> System.ArgumentOutOfRangeException: Parameter: defaultRepositoryType, Value: [log4net.Repository.Hierarchy.Hierarchy] out of range. Argument must implement the ILoggerRepository interface (Parameter 'defaultRepositoryType')
Actual value was log4net.Repository.Hierarchy.Hierarchy.
at log4net.Core.DefaultRepositorySelector..ctor(Type)
at log4net.Core.LoggerManager..cctor()
--- End of inner exception stack trace ---
at log4net.Core.LoggerManager.OnProcessExit(Object sender, EventArgs e)
at System.AppContext.OnProcessExit()
from logging-log4net.
@SwEngine thanks for the info. Can you check whether the change in #143 works for you?
from logging-log4net.
I could not build your code :( could you share a dll file? Sorry for inconvenience
from logging-log4net.
from logging-log4net.
I am adding your dll file to my project from project references, however
logger = LogManager.GetLogger(typeof(Logger));
this line gives error of:
Severity Code Description Project File Line Suppression State
Error CS0012 The type 'Assembly' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Logger C:\Users\Desktop\Logger\Logger\Logger.cs 15 N/A
from logging-log4net.
Can you put a simple repro somewhere on Github?
from logging-log4net.
@SwEngine maybe posting your csproj file could also help
from logging-log4net.
@SwEngine is this still relevant for you?
Otherwise I will close this at the end of the week.
from logging-log4net.
Related Issues (18)
- Enable automatic test runs on commit
- Cross-database testing
- Release automation (for the most part)
- Fix dotnet (ie not netfx) test run
- NPM script to generate beta packages
- Dropping support for older runtimes HOT 6
- Thread prints generic thread name instead of ID ".NET TP Worker" HOT 1
- [Bug] Android Archiving failing due to file being used by another processes HOT 2
- NullRefException from shutdown in 2.0.16 HOT 11
- Add support for nullable annotations
- Remove deprecated code for 3.0 HOT 4
- Enable building log4net with docker container
- Most links in the documentation are broken HOT 2
- Possible System.IndexOutOfRangeException in AppenderSkeleton.Finalize() HOT 3
- 3.0.0-preview.1 HOT 1
- Use Logging Services common pages HOT 4
- Add an `Installation` page and rework the `Download` page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logging-log4net.