diff --git a/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs b/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs index f00d3698f..5a09a6934 100644 --- a/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs +++ b/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs @@ -189,10 +189,10 @@ internal static object ConvertToType(string value, Type toType) if (toTypeInfo.IsInterface && !string.IsNullOrWhiteSpace(value)) { - var type = Type.GetType(value.Trim(), throwOnError: false).GetTypeInfo(); + var type = Type.GetType(value.Trim(), throwOnError: false); if (type != null) { - var ctor = type.DeclaredConstructors.FirstOrDefault(ci => + var ctor = type.GetTypeInfo().DeclaredConstructors.FirstOrDefault(ci => { var parameters = ci.GetParameters(); return parameters.Length == 0 || parameters.All(pi => pi.HasDefaultValue);