Error opening platform V10 - Cannot perform Runtime Binding

Asked

Viewed 48 times

2

When executing 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)

inserir a descrição da imagem aqui

  • it seems clear to me the message, that something is null, objAplConf for example. Inspect everything that passes to the method AbrePlataforma you’ll find the problem

1 answer

0

This issue is resolved by the application of 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;
}

Which you must evoke in your method Main class Program:

AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

Confirm that all specific DLL’s SPRINGTIME are with the property Copy Local = False.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.