Thursday, 10 October 2013

How to fix the dreaded Grey Screen of Death in Syspro

If you add a custom-written .Net User Control to a custom pane in Syspro, you can easily get the dreaded Grey Screen of Death - a blank grey screen (see screen shot below).



One of the most common reasons for this happening is that Syspro can't find one of the DLL's needed by your .Net solution. So where does Syspro look for the DLL's?


  1. The first DLL loaded must be in Syspro's BASE\ManagedAssemblies folder. This is the one you configure when you create the custom pane (see screen shot below).
  2. Then Syspro will look in its BASE directory, for all subsequent DLL's referenced by the first and subsequent DLL's; for those subsequent DLL's, Syspro WILL NOT look in the ManagedAssemblies directory. This is because Syspro doesn't have control over where subsequent DLL's are loaded from, so Windows tries to load them from the same folder that the Syspro client (IMPACT.EXE, IMPCSC.EXE, or SYSPRO.EXE) is run from. That directory is usually Syspro's BASE directory, NOT the ManagedAssemblies folder.
  3. Windows will then look in the GAC.

This is problematic because Syspro only distributes DLL's in the ManagedAssemblies folder automatically from the server to all the Syspro clients; custom DLL's in the BASE directory will not be distributed by Syspro.

There are a number of ways to solve this:

  1. Place your dependent DLL's in the BASE folder. This is the least-preferred option because you have to do it manually on each client PC.
  2. Place your dependent DLL's in the GAC. Also not a preferred option.
  3. Merge all your DLL's using ILMERGE, then place the merged DLL in the ManagedAssemblies folder.
    This works fine for WinForm-based applications, but won't work for WPF-based forms as ILMERGE can't merge all the WPF files.
  4. Add some code to your first DLL, then place your dependent DLL's in the ManagedAssemblies folder.
    This is the recommended solution.
    See this post for details: http://support.syspro.com/forums/viewtopic.php?f=1&t=4603#p20524


How to find what DLL's are not being loaded

Now we get to the point of this post: HOW to find what DLL's have not been loaded.
The key is to run ProcMon: run a trace while you invoke the custom pane for the first time after starting Syspro.
Then use a reasonable filter such as shown in the screen shot below:



Then search the list and you may find what DLL has been missed, as shown in the screen shot below.



This method doesn't always seem to work, for reasons I don't yet know, but its the best method I know of to find the exact problem directly.

No comments:

Post a Comment