Closed jni- closed 11 years ago
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.
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.
Did you try catching the ReflectionTypeLoadException
exception and looking at the LoaderExceptions
property? Perhaps my code is doing something wrong that PdfSharp doesn't like.
That exception is one of my most hated exceptions. I've seen it in production systems a few times, but the LoaderExceptions
property is never logged and its details aren't in the ToString()
of the exception so they're pretty tricky to figure out.
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.
FYI @jni-, this has been fixed in the 1.1.4 release :)
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 :