Hydra AppDomain.Unload broken!

I know this will affect almost no one else, but this is critical to me.

I’ve created a diagnostics device based on the Hydra I use for pretty much everything I do here. I’ve got it running my 3D printer, testing out new versions of Clix/Tinkr, etc. And all of that relies on AppDomains.

I can load into the domain fine, but unload fails under every test. I’ve tried the same project on the Cobra I & II as well as ChipworkX (4.1), it all works fine there with no changes, so this is definitely a Hydra issue.

I can limp along for now, but this leaves me having to restart the device regularly as it runs out of memory not being able to unload applications cleanly.

Can you compare this on 2 devices, that both run the same firmware from same SDK. And then provide a simple example test application please.

Already have done. Works perfect on both Cobras.

I’m changing to 4.1 to test and installing 2012 for 4.3, see if it might be 4.2 specific.

I’ll get some code posted as well, it’ll take me time to extract a portion out.

I’m having trouble finding 4.1 or 4.3 firmware for Hydra. Where is it located?

Not available but why?

Just so I could test other firmwares.

I’ve 2 working Hydra’s here (and a 3rd that’s been dead since I tried to connect an RTC :frowning: ) both fail the same.

Cobra II works fine.

Grabbing code for you now.

@ Gus - I’ve been going through the code and found that Unload is only “half” broken. Unload on it’s own will work.

I haven’t located the exact line that’s preventing unload from working properly on Hydra with my solution (again it works on other devices); however it’s now a non-issue.

While working through I rewrote my application launcher. It’s now cleaner than ever and I believe is working properly on Hydra. I’ll have to run more tests to be sure, but it’s very promising.


The issue was trying to unload an AppDomain in response to a touch message received in a non default domain.

The work around was incredibly silly, but it makes it function on all devices.

I’m going to go not think for awhile now. :wink:

1 Like

@ Skewworks

Hi Tom,
Did you do anything special to load the assemblies into a domain? because when I try it still hangs here… can you share any info in this regards, or is it top secret?


The loading part is rather simple and I published it in a PDF here:

The special bit doesn’t come in until you try to terminate apps from outside the default domain on the default thread.

For that I used my messaging class (Clix & Tinkr core) to notify the default domain which then breaks out of the touch thread and calls the unload. It’s a bit of a ways around but my 2.0 standard (not released yet) wraps it all into a base class so the end user doesn’t need to worry about it.

On thing to note, if you application has dependencies you must load them too and you must do it in order or else it will have issues.

great thanks for sharing, i’ll try it and let you know if it works on my end…