Skip to content

Commit b4fd9da

Browse files
mono fix (#320)
1 parent 8411ac4 commit b4fd9da

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/JsonRpc/HandlerTypeDescriptorProvider.cs

+14-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,20 @@ internal static IEnumerable<IHandlerTypeDescriptor> GetDescriptors(IEnumerable<A
106106
}
107107
}
108108
)
109-
.Where(z => ( z.IsInterface || ( z.IsClass && !z.IsAbstract ) ) && typeof(IJsonRpcHandler).IsAssignableFrom(z))
109+
.Where(z => ( z.IsInterface || ( z.IsClass && !z.IsAbstract ) ))
110+
// running on mono this call can cause issues when scanning of the entire assembly.
111+
.Where(
112+
z => {
113+
try
114+
{
115+
return typeof(IJsonRpcHandler).IsAssignableFrom(z);
116+
}
117+
catch
118+
{
119+
return false;
120+
}
121+
}
122+
)
110123
.Where(z => MethodAttribute.From(z) != null)
111124
.Where(z => !z.Name.EndsWith("Manager")) // Manager interfaces are generally specializations around the handlers
112125
.Select(HandlerTypeDescriptorHelper.GetMethodType)

0 commit comments

Comments
 (0)