Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

System.MissingMethodException on 2 systems, not on 2 others (probably solved) 09 Jul 2022 21:57 #23003

  • ic2
  • ic2's Avatar
  • Topic Author


  • Posts: 1661
  • I have an X# program which runs on my machine and I installed it for a client. Both work. Now Kees used it too and on his machine it didn't start. Application log shows KERNELBASE.dll as faulty module, but as usual for Microsoft none of the log entries are of any use.

    So I copied the exe on a laptop where it failed as well, this time with:
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.MissingMethodException
       at <Module>.$AppInit()
       at MyProgram,Exe.Functions.Start()

    In posts with this error incorrect DLL's are suggested as the cause, but even when I copy all DLL's from the working Pc and start my program in a DOS prompt with Set Path = c:\MyProgramDir I get the same error. It doesn't even reach the first line in the Constructor.

    I then copied the full VS program/solution directories from the Pc to the laptop to debug it there. Originally it didn't compile there because it needed a reference to System.Windows.Forms (it's a WPF program with some Winforms command). No idea why it worked without on my Pc (there is a System.Windows reference which I'd say should be enough) but: adding the reference helped and the program compiled and the exe, once copied to the working directory, worked.

    So I added this same reference to the Pc solution, which should make it equal to the laptop solution and thought this issue would somehow be caused by this "missing" reference. I copied the resulting exe from the Pc to the laptop, but got the same System.MissingMethodException again. This while the exe created on the laptop, which should be the same as the one created on the Pc (and copied to the same location with the same DLL's), works.....

    EDIT/NOTE: I think I just solved it, at least the reason my Pc version didn't work on the laptop. I realized that the laptop's X# was a few versions behind. I installed the same versions as on my Pc and saw that the option Register runtime DLLs in the GAC (recommended !) was still checked. I unchecked it, installed, recreated the exe (on the Pc) which worked as it did, then copied the exe from the PC and now it worked. Next to check is Kees' system (I'll let you know)

    So I lost (again, I see that I had this earlier) time because of that piece of Microsoft shit called the GAC. I can recommend not to recommend to check this box.

    Dick

    Please Log in or Create an account to join the conversation.

    Last edit: by ic2.

    System.MissingMethodException on 2 systems, not on 2 others (probably solved) 10 Jul 2022 11:18 #23004

    • robert
    • robert's Avatar


  • Posts: 3588
  • Dick,
    The
    <Module>.$AppInit()
    is a method that is generated by the X# compiler. It is called at startup and it calls all $Init1(), $Init2() (if any) and $Init3() (if any) methods in the function classes of the X# compiled assemblies that you have linked to your app.
    These compiler generated $Init1() .. $Init3() methods call the code in so called INIT PROCEDURES.
    Do you have any INIT procedures in your code (PROCEDURE MyProc _INIT1 for example)?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Last edit: by robert.

    System.MissingMethodException on 2 systems, not on 2 others (probably solved) 11 Jul 2022 13:17 #23005

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1661
  • Hello Robert,

    robert wrote: Do you have any INIT procedures in your code (PROCEDURE MyProc _INIT1 for example)?


    No, none at all.

    Dick

    Please Log in or Create an account to join the conversation.

    System.MissingMethodException on 2 systems, not on 2 others (probably solved) 11 Jul 2022 13:47 #23006

    • robert
    • robert's Avatar


  • Posts: 3588
  • Dick,
    Then most likely you did not include one of the DLLs that you have in the references list of your app.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    System.MissingMethodException on 2 systems, not on 2 others (probably solved) 11 Jul 2022 16:53 #23007

    • Chris
    • Chris's Avatar


  • Posts: 3974
  • Robert,

    The problem was that Dick was just using a very old X# build in the other machine (so also had in the GAC very older runtime than the one his assemblies, were built against), he mentioned this in an edit of his firs post. After installing the latest build, it all worked fine.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1