Error handling while loading types from assembly - #22
Conversation
Error handling while loading types from assembly
Daniel15
commented
Sep 1, 2013
Thanks, I'll have to investigate further and see what's causing the issue, but I'm happy with this as an interim fix. You should be able to download a NuGet package with this fix as soon as the build server builds it. |
jni-
commented
Sep 1, 2013
Hi, thanks for the merge! The error wasn't coming from your side, it's one of our assemblies that caused this issue. We pretty much gave up figuring out the details of that. |
Daniel15
commented
Sep 1, 2013
Did you try catching the That exception is one of my most hated exceptions. I've seen it in production systems a few times, but the |
jni-
commented
Sep 1, 2013
Yes I did manage to catch it in the debugger, but it still made no sense at all (can't remember it though). And I don't this it's your code, we have some assembly scanning code as well that looks pretty much identical to yours, and the same thing happens with the same assembly. I might give it another go this week, just because it bugs me. It's not easy to catch either, since all of this happens on the Application_Start(), but I have a way to trick it. However since it comes from a third party assembly, it's not going to be that easy to figure out I guess. |
Daniel15
commented
Sep 10, 2013
FYI @jni-, this has been fixed in the 1.1.4 release :) |
jni-
commented
Sep 10, 2013
thank you! |
Some assemblies on our project gives us a headache while it comes to loading types from assemblies in the appdomain. Actually only one does, PdfSharp. You may list PdfSharp's assembly from the appdomain, but once you call assembly.GetTypes() on it, it throws a
ReflectionTypeLoadException. We're trying to see why it is like that, but in the mean time I think it simply makes RouteJs a tiny bit more robust anyways, so I'm submitting this fix.I am not including a test for this fix, since I have no idea how to reproduce it without adding a dependency to a faulty assembly (and I'm not sure how to reproduce that).
Here is the complete error we had, I tried to translate the relevant parts :