AppDomain appDomain = AppDomain.CreateDomain("appDomain", null, null);
try
{
appDomain.AppendPrivatePath(@"C:\DLLS\");
appDomain.Load(@"FF-DeliousDateTimeRequestor");
ObjectHandle o = appDomain.CreateInstance("FF-DeliousDateTimeRequestor",
"DeliousTools.Loader");
object ob = o.Unwrap();
IDeliousToolsInt obj = (IDeliousToolsInt)ob;
obj.Start();
}
finally
{
AppDomain.Unload(appDomain);
}
Does anyone know how to solve this exception:
An unhandled exception of type 'System.InvalidCastException' occurred in
NewerDeliousLauncher.exe
Additional information: Specified cast is not valid.
The error occurs in this line:
IDeliousToolsInt obj = (IDeliousToolsInt)ob;
Thank you in advance!