public class Proxy : MarshalByRefObject
{
public Assembly GetAssembly(string assemblyPath)
{
try
{
return Assembly.LoadFile(assemblyPath);
}
catch (Exception)
{
return null;
// throw new InvalidOperationException(ex);
}
}
}
string dynamicClassPath = File Path;
AppDomain domains = AppDomain.CreateDomain("New domain name");
Type type = typeof(Proxy);
Proxy myObject = (Proxy)domains.CreateInstanceFromAndUnwrap(dynamicClassPath, type .FullName);
using System;
namespace ForTest
{
public class Dynamic_Val_001
{
private string _Prop_Name;
private string _Prop_Address;
public virtual string Prop_Name
{
get
{
return this._Prop_Name;
}
set
{
this._Prop_Name = value;
}
}
public virtual string Prop_Address
{
get
{
return this._Prop_Address;
}
set
{
this._Prop_Address = value;
}
}
}
}
the Dll B code is
using System;
namespace ForTest
{
public class Val_001
{
public virtual Tuple<bool, string> isValid(Dynamic_Val_001)
{
return new Tuple<bool, string>(false, "Success");
}
}
}
Now the Dll B have a one tuple bool function with one parameter, In that parameter is Dll A class name,so Dll B is depends on dll A.
So how to Call that Dll A class from Dll B.