Skip to content

Commit

Permalink
mono fix (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll authored Aug 16, 2020
1 parent 8411ac4 commit b4fd9da
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/JsonRpc/HandlerTypeDescriptorProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,20 @@ internal static IEnumerable<IHandlerTypeDescriptor> GetDescriptors(IEnumerable<A
}
}
)
.Where(z => ( z.IsInterface || ( z.IsClass && !z.IsAbstract ) ) && typeof(IJsonRpcHandler).IsAssignableFrom(z))
.Where(z => ( z.IsInterface || ( z.IsClass && !z.IsAbstract ) ))
// running on mono this call can cause issues when scanning of the entire assembly.
.Where(
z => {
try
{
return typeof(IJsonRpcHandler).IsAssignableFrom(z);
}
catch
{
return false;
}
}
)
.Where(z => MethodAttribute.From(z) != null)
.Where(z => !z.Name.EndsWith("Manager")) // Manager interfaces are generally specializations around the handlers
.Select(HandlerTypeDescriptorHelper.GetMethodType)
Expand Down

0 comments on commit b4fd9da

Please sign in to comment.