System.MissingMethodException on 2 systems, not on 2 others (probably solved)
Posted: Sat Jul 09, 2022 7:57 pm
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:
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
So I copied the exe on a laptop where it failed as well, this time with:
Code: Select all
Description: The process was terminated due to an unhandled exception.
Exception Info: System.MissingMethodException
at <Module>.$AppInit()
at MyProgram,Exe.Functions.Start()
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