From 66c73176b07b3fb1a1f8731fe506d44727fe9d31 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Mon, 20 Jun 2016 14:50:06 +1000 Subject: [PATCH] Fix error when target type is not loadable --- src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);