Error opening platform V10 - Can not perform runtime binding

2

When you run the code

            Dim objAplConf As StdBSConfApl = New StdBSConfApl()
            Dim Plataforma As StdPlatBS = New StdPlatBS()

            objAplConf.Instancia = Instance
            objAplConf.AbvtApl = "ERP"
            objAplConf.LicVersaoMinima = "10.00"

            Plataforma.AbrePlataforma(CType(Line, EnumTipoPlataforma), objAplConf)

    
asked by anonymous 07.06.2018 / 12:13

1 answer

0

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.

    
10.08.2018 / 12:53