Powerbuilder 12.6 .NET Error number 0, Function not found

467 views Asked by At

I've been working on a company-internal time-management application for quite some time. Each time I complete a new version, I deploy the application and copy the .exe and .pdb and so forth into a runtime folder on a network server (running Windows Server 2008 R2 Standard, all important updates installed). Employees access the server through Remote Desktop, log on (using integrated login) and log their work hours.

This worked fine until approximately mid-October of this year, when new versions of my application produced the attached error message: PFC version of error message (Error number 0, Function not found, line 0, everything else blank.) The application works fine on my development machine (Windows 8.1 Pro, all important updates installed, in the IDE as well as from the .exe) as well as a clean virtual Windows 7 install (with .NET Framework 4.0 and the Visual C++ 2010 Redistributable installed, the runtime packager executed to register dlls etc.). It produces the aforementioned error message on the server as well as on a colleague's (Windows 10) machine.

The error seems to be triggered by attempting to open a window (frame or otherwise). I tried to debug using message boxes in the following order:

(in event pfc_open of the application manager object)

(populate sqlca from .ini, perform integrated logon, etc.)

MessageBox("before frame", "before frame")

OpenWithParm(w_frame, ls_user)

MessageBox("after frame", "after frame")

The message box "before frame" appears, then the error message appears and the application halts.

The application uses PFC, but a simple non-PFC application that simply opens a window and displays a text box displays similar behavior: if the message box comes before the open(w_window), it displays, otherwise the application displays this error message: basic hello world error and halts.

I'm using Powerbuilder .NET 12.6.0, Build 4108 (I believe this is the latest EBF version). Older versions of the application still work on the server. It appears that applications compiled after a certain date do not work on the server.

Here's an excerpt from PBTrace after an attempt to open one of these applications (the system language is German, and I've translated German words into English):

Method: Void _init()
Exception Type: System.MissingMethodException
Exception Message: System.MissingMethodException: Method not found: "Void Sybase.PowerBuilder.WPF.PBWindow.set_RelevantSession(Sybase.PowerBuilder.WPF.PBSession)".
   at c__w_window._init()
   at c__w_window..ctor() in c:\work\pb126\hello_world_ohne_pfc.out\hello_world_ohne_pfc_w_window_w.cs:Line 0.
Exception Source: hello_world_ohne_pfc
Exception StackTrace:    at c__w_window._init()
   at c__w_window..ctor() in c:\work\pb126\hello_world_ohne_pfc.out\hello_world_ohne_pfc_w_window_w.cs:Line 0.

I looked at the documentation for error numbers, and they seem to start at 1 (Divide by zero), with no entry for number 0. I searched online for solutions to similar problems, and I found some other cases with error number 0, but different error texts. The solutions there included commenting out the line that caused the error, but that's not really an option here, as I need to open the frame window and other windows in it. I also couldn't find any information about that specific method that was apparently not found.

As stated previously, we created a virtual machine with a fresh Windows 7 install in an attempt to reproduce the problem. After installing the prerequisites (.NET Framework, etc.), both my time-management application as well as the non-PFC Hello World application work. We attempted to rule out our anti-virus program (F-Secure) as a source for the error, so we installed F-Secure on the virtual machine and installed all updates, but both applications still worked fine. We also attempted to rule out Windows updates by installing all important Windows updates in the virtual machine, but with all important updates including security and quality rollups for the .NET Frameworks, the applications still work fine. We weren't able to reproduce the error in the virtual machine. The only thing I can think of that changed around the time things stopped working is Windows updates, but those don't seem to be the cause of the error, as the applications work in an up-to-date Windows 7 virtual machine.

Could it still have to do with an update? Did anything else major happen around mid-October? Is there anything else I'm missing?

If more information is needed, please let me know. Thanks for your attention.

1

There are 1 answers

0
SimonSharpe On BEST ANSWER

Here's how I was able to solve the problem:

user743414's answer made me think about the .NET framework instead of Windows updates or other things. I did some research and found out that there is a Sybase.Powerbuilder.WPF.dll in the .NET Framework GAC. In the virtual machine, I ran two 12.6 .NET runtime packagers, one created before and one created after the point in time where the applications stopped working. Each resulted in a different version of this .dll being registered. With the old version of the .dll, I was able to reproduce the error, and the new version fixed it. With that in mind, I ran the new version of the runtime packager in the terminal server. I had to run it again to remove and reinstall the runtime, and reboot, to make sure the new version of the .dll was registered, and in the end it was, and my applications worked again.

Thanks again to user743414!