There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Enhancement: Expose Host AppDomain
We have started using CassiniDev in an internal project (great tool by the way!). We are using it in conjunction with Watin and FirefoxPortable to do web UI testing.
We had an issue that required access to the hosted AppDomain. We needed to modify some comms behaviour within the virtual directory. We had a static class that we wanted to instantiate with some injected behaviour to ensure testing was possible without a full
To enable this, we exposed a property on Host to provide the AppDomain.CurrentDomain, and exposed this via a property on the Server called HostAppDomain. We wrap this in a modified CassiniDevServer class so that we can write code such as:
Server _server = new Server(..);
StaticType remoteObject = (StaticType)_server.HostAppDomain.CreateInstanceAndUnwrap("Assembly.Type.Exists.In","NameSpace.To.StaticType");
remoteObject.ExecuteMethod("Running in AppDomain for VirtualDirectory");
Attached are the changes required (there were a few other properties added that we found useful). Not sure if there is an easier way to achieve what we were trying to do, happy to discuss. Would be great if this ability could be provided in the trunk though...
PS Apologies about zip file, couldn't attach more than one file???? (sigh)