I am trying to do the following. App A is the \"mother app\". It stays open. App B is just a .DLL where I write some classes that are derived from an interface specified in
Your code still runs in the mother AppDomain, as you're pulling in assemblies and types into there. Any code should run in the spawned domain. I've shown one way to set something like that up on my website : A simple way to start your code in a different AppDomain
I'm not 100% sure on that but that's certainly one step you'll have to undertake
Update
In terms of the solution presented there, your instantiation of a runner would happen in an inheritor of DomainLifetimeHook. The infrastructure shown ensures that the Start and Stop methods run in the AppDomain created by the class AppDomainExpander. That Expander is the class that creates the new domain, hence your domain setup should go in the Create method of the domain.
The main problem is where you do:
Type type = assm.GetType("TestClient." + typeName);
This is happening in App A's main AppDomain, and the consequence is that the main AppDomain locks App B's assembly .dll
The link in flq's answer to his blog post should work for you.
The type has to be loaded into the main appdomain as soon as you unwrap the ObjectHandle. To work properly, you need to operate on the non-unwrapped ObjectHandle.