-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StackOverflowException - how to debug? #48
Comments
As of 0.8 you can now step through the Costura template. Debugging (from the wiki) Hope that helps. |
(Ugh. Sorry I missed the wiki) Ok, so now I see the problem but don't know how to fix, maybe you can advise. My executable references two different versions of an assembly, happens to be Microsoft.Practices.Unity 2.1.505.0 and 3.0.0.0. So in Costura's ILTemplate.cs the referencedAssemblies array contains an entry for each. When the ResolveAssembly method is called to resolve the 3.0.0.0 version, referencedAssemblies is enumerated, and it comes across the 2.1.505.0 version first and immediately calls Assembly.Load (line 27) resulting in StackOverflowException soon after. Maybe it should continue to enumerate the entire array before giving up and calling Assembly.Load? I have confirmed that things do work properly when the referenced DLLs are left in same folder as the EXE. No surprise, because Costura's ResolveAssembly is not called, but just to let you know that things do work properly when Costura is not called upon to resolve the assembly. Thanks, Nate |
Hmmm, ok. You could exclude Microsoft.Practices.Unity from Costura, causing both to be loaded from disk. But I'm wondering why do you have 2 different versions of Unity? Could you redirect the versions to 3.0? |
I think I've been down that path with no luck, but it started to involve more .NET plumbing than I'm familiar with. Here's what I've found out...
Interested to know if you think that Costura's ResolveAssembly method is bailing out early, or maybe the fix is more complicated than that Hope that helps, thanks |
@SimonCropp Could you please explain line https://github.com/Fody/Costura/blob/master/Template/ILTemplate.cs#L25 to me?
I don't understand why the version check passes if they're not the same. |
I think it was because .net was firing a AssemblyResolve for an assembly with an incorrect version number, probably dues to some binding redirect issue. But looking at it now I dont think that is a case we should handle. And obviously a shitty commit on my part since i did not add a unit test of valid comments so even if the change is justified it should be rolled back. i can then try to replicate again and raise a proper issue for it. |
Ok, I've removed that code in 1.0. I agree, if the assembly resolver is failing for assemblies that are not managed by Costura, we shouldn't be dealing with it. |
Looks like the fix is working for me. Thank you, I've got Costura back up and running (Good timing, delivery due this week!) On Sat, Feb 1, 2014 at 2:45 AM, Cameron MacFarland
|
(Is this proper forum for this type of question?)
Costura was working quite nicely for me, but looks like I've done something it does not like. When I launch my application I'm receiving a StackOverflowException inside Costura.AssemblyLoader.ResolveAssembly.
I'm working with a Prism app (WPF), the exception occurs when I call my Bootstrapper.Run method, so I assume there is some problem with loading the Prism libraries
Any advice is appreciated to save time, maybe something simple you might know about.
Thanks
Nate
The text was updated successfully, but these errors were encountered: