This question is solved by applying a AssemblyResolver
:
static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
string assemblyFullName;
System.Reflection.AssemblyName assemblyName;
const string PRIMAVERA_FOLDER = @"C:\Program Files (x86)\PRIMAVERA\SG100\Apl\";
assemblyName = new System.Reflection.AssemblyName(args.Name);
assemblyFullName = System.IO.Path.Combine(PRIMAVERA_FOLDER, assemblyName.Name + ".dll");
if (System.IO.File.Exists(assemblyFullName))
return System.Reflection.Assembly.LoadFile(assemblyFullName);
else
return null;
}
In your method Main
of class Program
:
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
Confirm that all SPRING-specific DLLs have the Copy Local = False
property.