Hi
I a method that loads all of the dll files and their paths, namespaces as well as all the relevant class names from a database and fills a custom created object with all of these relevant information, which then gets added to a hashtable with a relevant key.
here is the structure of the object:
public class AppDomObject
{
public AppDomain campaignDomain;
public AssemblyName assemblyName;
public Assembly campignAssembly;
public string Path;
public string nameSpace;
public string ClassName;
public Type type;
public MethodInfo methodInfo;
}
Now the problem is that whenever I have to call a method in that dll, it needs to keep track (Sessions) of the user, but calling the method means that a new instance of the class has to be created, which loses all of the data. Is there anyway I can work around this?
The method is shown below:
AppDomObject refObject = (AppDomObject)AppDomainHolder.RunningDomains[USSD_String];
classInstance = Activator.CreateInstance(refObject.type, null);
refObject.methodInfo = refObject.type.GetMethod("SomeMethod");
object result = refObject.methodInfo.Invoke(classInstance, new object[] { req.msisdn, req.request });
Thanks in advance for any help.