Unable to load method [methodname] from class [classname]

Discussion forum about all things Team Developer 5.x and 6.x
OeavDev
Austria
Posts: 98
Joined: 15 May 2018, 11:18
Location: Vienna

Unable to load method [methodname] from class [classname]

Post by OeavDev » 17 May 2018, 10:42

Dear community,

sometimes we get a very strange error when calling a function from a .NET assembly: "unable to load method xxx from class zzz. "
We use .NET explorer to generate the APL from an Assembly File. The assembly file contains various instance methods with returntype int.

This error seems to occur completely random. If it occurred once, we have no chance to call the 'broken' method again. All other methods are still functional. After restarting the application, the broken method works again - with the same payload! The .NET assembly is written in c#, methods are public and instanced and unfortunately we cannot reproduce this error in our testsystem.
  • .NET dll is compiled as x86 - .NET Version 4.5
    TD Version is 6.2 SP5 Update 1 Build 48134
    Syntax C#:

Code: Select all

namespace aaa.bbb
{
    public class zzz
    {
        public int xxx(string a, string b, string c, string[] d, string e, string f, string g, bool h, ref string i, ref string j)
        {
            ...
        }      
    }
}
Any ideas?



regards
Michael

OeavDev
Austria
Posts: 98
Joined: 15 May 2018, 11:18
Location: Vienna

Re: Unable to load method [methodname] from class [classname]

Post by OeavDev » 23 May 2018, 06:51

Seems, it can be solved by avoiding string arrays!

Code: Select all

namespace aaa.bbb
{
    public class zzz
    {
    
        public int addD(string d)
        {
           DList.Add(d)
        }
    
        public int xxx(string a, string b, string c, string e, string f, string g, bool h, ref string i, ref string j)
        {
            nReturn = xxx_(a, b, c, DList.ToArray(), e, f, g, h, ref i, ref j)
            DList.Clear();
            return nReturn;
        }      
        
        private int xxx_(string a, string b, string c, string e, string f, string g, bool h, ref string i, ref string j)
        {
            ...
        }      
    }
}

Return to “General Discussion TD 5.x and 6.x”

Who is online

Users browsing this forum: [Ccbot] and 0 guests