internal static Object CreateDataForDomainCallback(Object[] args)
{
// Ensure that the well known channels are registered in this domain too
RegisterWellKnownChannels();
// Marshal the app domain object
ObjRef objref = MarshalInternal(
Thread.CurrentContext.AppDomain,
null,
null,
false);
ServerIdentity si = (ServerIdentity)MarshalByRefObject.GetIdentity(Thread.CurrentContext.AppDomain);
si.SetHandle();
objref.SetServerIdentity(si.GetHandle());
objref.SetDomainID(AppDomain.CurrentDomain.GetId());
return objref;
}