I am trying to do the following:
if(domain != null)
{
AppDomain.Unload(domain);
}
domain = AppDomain.CreateDomain(appDomainName);
Assembly assembly = domain.Load(location);
and the code throws FileLoadException
but when i do the following there is no exception :
Assembly assembly = Assembly.LoadFrom(location);
Could you please tell me what could be the problem.
Thank you.
Edited:
The reason I want to load the assembly it because i want to create instance of the class is in it using factory method of it could please suggest a solution