Skip to content

Commit

Permalink
Fix error when target type is not loadable
Browse files Browse the repository at this point in the history
  • Loading branch information
nblumhardt committed Jun 20, 2016
1 parent 67bfa3f commit 66c7317
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 66c7317

Please sign in to comment.