You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce:
Simple console application, Set properly LogConfiguration configuration from file or from strings.
Then:
LogManager.Configure(configuration);
log = LogManager.GetLogger(); <-- crashes
Stack trace:
Common.Logging.ConfigurationException
HResult=0x80131500
Message=Failed obtaining configuration for Common.Logging from configuration section 'common/logging'.
Source=Common.Logging
StackTrace:
at Common.Logging.Configuration.ArgUtils.Guard[T](Function`1 function, String messageFormat, Object[] args)
at Common.Logging.Configuration.ArgUtils.Guard(Action action, String messageFormat, Object[] args)
at Common.Logging.LogManager.BuildLoggerFactoryAdapter()
at Common.Logging.LogManager.get_Adapter()
at Common.Logging.LogManager.GetLoggerT
at TestOldFramework.Program.Main(String[] args) in d:\dokumenty\Visual Studio 2019\source\repos\Common.Logging.Ext\TestOldFramework\Program.cs:line 25
Inner Exception 1:
FileNotFoundException: Nie można załadować pliku lub zestawu 'System.Reflection.TypeExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' lub jednej z jego zależności. Nie można odnaleźć określonego pliku.
"Nie można załadować pliku lub zestawu" = "File or assembly could not be loaded"
Console application is in .Net 4.6.1 and Common.Logging is in Netstandard 1.3
An error occurs in ArgUtils.cs on following line:
if (!typeof(T).IsAssignableFrom(valType))
This is because NetStandard doesn't have IsAssignableFrom method and System.Reflection.TypeExtensions is used. However it cannot be loaded in .NET 4.6.1
Suggested solution:
#if DOTNETCORE
if (!typeof(T).GetTypeInfo().IsAssignableFrom(valType.GetTypeInfo()))
#else
if (!typeof(T).IsAssignableFrom(valType))
#endi
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
Simple console application, Set properly LogConfiguration configuration from file or from strings.
Then:
LogManager.Configure(configuration);
log = LogManager.GetLogger(); <-- crashes
Stack trace:
Common.Logging.ConfigurationException
HResult=0x80131500
Message=Failed obtaining configuration for Common.Logging from configuration section 'common/logging'.
Source=Common.Logging
StackTrace:
at Common.Logging.Configuration.ArgUtils.Guard[T](Function`1 function, String messageFormat, Object[] args)
at Common.Logging.Configuration.ArgUtils.Guard(Action action, String messageFormat, Object[] args)
at Common.Logging.LogManager.BuildLoggerFactoryAdapter()
at Common.Logging.LogManager.get_Adapter()
at Common.Logging.LogManager.GetLoggerT
at TestOldFramework.Program.Main(String[] args) in d:\dokumenty\Visual Studio 2019\source\repos\Common.Logging.Ext\TestOldFramework\Program.cs:line 25
Inner Exception 1:
FileNotFoundException: Nie można załadować pliku lub zestawu 'System.Reflection.TypeExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' lub jednej z jego zależności. Nie można odnaleźć określonego pliku.
"Nie można załadować pliku lub zestawu" = "File or assembly could not be loaded"
Console application is in .Net 4.6.1 and Common.Logging is in Netstandard 1.3
An error occurs in ArgUtils.cs on following line:
if (!typeof(T).IsAssignableFrom(valType))
This is because NetStandard doesn't have IsAssignableFrom method and System.Reflection.TypeExtensions is used. However it cannot be loaded in .NET 4.6.1
Suggested solution:
#if DOTNETCORE
if (!typeof(T).GetTypeInfo().IsAssignableFrom(valType.GetTypeInfo()))
#else
if (!typeof(T).IsAssignableFrom(valType))
#endi
The text was updated successfully, but these errors were encountered: