I had now the case, that an EXE program did not start because of a missing DLL. The program started and stopped without a message. In the event log I found the following entry:
System.IO.FileNotFoundException
bei <Module>.$AppInit()
bei RadixDN.Exe.Functions.Start()
I looked into $AppInit() with ILSpy and I saw an exception handling. Is it probably possible that in case of an EXE file you open a windows message box with the exception? When having Win32-programs with a missing DLL normally the Runtime shows such a message.
Thanks
Arne
Possibly error message when starting program with missing included DLL
- ArneOrtlinghaus
- Posts: 413
- Joined: Tue Nov 10, 2015 7:48 am
- Location: Italy
Possibly error message when starting program with missing included DLL
Hi Arne,
that is a problem I had several times, but I don't thing the devteam can do anything here as it is the .NET Runtime that loads the DLLs.
Wolfgang
that is a problem I had several times, but I don't thing the devteam can do anything here as it is the .NET Runtime that loads the DLLs.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Possibly error message when starting program with missing included DLL
Hi Arne,
I have looked better - maybe there couid be a solution:
https://social.msdn.microsoft.com/Forum ... ?forum=wpf
Wolfgang
I have looked better - maybe there couid be a solution:
https://social.msdn.microsoft.com/Forum ... ?forum=wpf
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Possibly error message when starting program with missing included DLL
Arne,
Adding a message box should be possible, however that will add a dependency to System.Windows.Forms to all apps. Or we need to add a _DLL FUNCTION in the generated code for MessageBox in user32.dll.
And that would make our programs incompatible with non windows platforms...
Robert
Adding a message box should be possible, however that will add a dependency to System.Windows.Forms to all apps. Or we need to add a _DLL FUNCTION in the generated code for MessageBox in user32.dll.
And that would make our programs incompatible with non windows platforms...
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Possibly error message when starting program with missing included DLL
Hi Robert,
and write an error log?
I suspect this check must be executed before any user code is executed, so there is no possibility to register a handler.... Or would it be possible to call a function with a fixed name in the exe, when it exist?
Wolfgang
and write an error log?
I suspect this check must be executed before any user code is executed, so there is no possibility to register a handler.... Or would it be possible to call a function with a fixed name in the exe, when it exist?
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Possibly error message when starting program with missing included DLL
Wolfgang,
I think that calling a function in the EXE should be possible, as long as that function does not depend on any of the initializers that are called from $AppInit() ( init procedures).
I could pass the exception object to that function.
Do you have a suggestion for a function name ?
Robert
I think that calling a function in the EXE should be possible, as long as that function does not depend on any of the initializers that are called from $AppInit() ( init procedures).
I could pass the exception object to that function.
Do you have a suggestion for a function name ?
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
-
- Posts: 200
- Joined: Wed Oct 09, 2019 6:51 pm
Possibly error message when starting program with missing included DLL
If Arne has a similar customer-PEBCAC problem as the original poster of the linked thread, another option is to rename the .exewriedmann wrote:I have looked better - maybe there couid be a solution:
https://social.msdn.microsoft.com/Forum ... ?forum=wpf
Whatever_StartOptimized.exe
and to add another program (depending on nothing but itself, perhaps a JSON or dbf data store and perhaps the GAC) first verifying all dll are in expected place and fit expected CRC-value, either showing nice error msg or starting "Whatever_StartOptimized.exe" if all is ok.
Sometimes going the long way is easier than to confront PEBCAC customers head on...
regards
thomas
Possibly error message when starting program with missing included DLL
Hi Robert,
that would be great, thank you!
As function name I could suggest "XSharpInitError()", but I'm not really good inventing names <g>.
The important thing is that a sample for such a funtion would be added by XPorter and also in the sample applications in both XIDE and VS, so people sees it and uses it also in own applications.
Wolfgang
that would be great, thank you!
As function name I could suggest "XSharpInitError()", but I'm not really good inventing names <g>.
The important thing is that a sample for such a funtion would be added by XPorter and also in the sample applications in both XIDE and VS, so people sees it and uses it also in own applications.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
Possibly error message when starting program with missing included DLL
Guys
,
i think the first question should be how Arne is currently catching exceptions ? Is he really using a WPF app, where it seems there is a catch problem when i follow Wolfgang´s link ?
i´m using a global Exception handler, and til now i see all errors using the X# buildin ErrorDialog. Maybe Arne can give a sample when exactely such a exception handling fails ?
regards
Karl-Heinz
,
i think the first question should be how Arne is currently catching exceptions ? Is he really using a WPF app, where it seems there is a catch problem when i follow Wolfgang´s link ?
i´m using a global Exception handler, and til now i see all errors using the X# buildin ErrorDialog. Maybe Arne can give a sample when exactely such a exception handling fails ?
Code: Select all
[STAThread];
FUNCTION Start() AS INT
LOCAL oDlg AS ErrorDialog
LOCAL oXApp AS XApp
TRY
oXApp := XApp{}
oXApp:Start()
CATCH e AS Exception
oDlg := ErrorDialog { e }
oDlg:showDialog()
END TRY
RETURN 0
CLASS XApp INHERIT App
METHOD Start()
.. open the first Window
RETURN 0
END CLASS
Karl-Heinz
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
Possibly error message when starting program with missing included DLL
Hi Arne
Would be interesting to know. When you add this init proc to your app do you see the debout() content before your app closes ?
regards
Karl-Heinz
Would be interesting to know. When you add this init proc to your app do you see the debout() content before your app closes ?
Code: Select all
PROCEDURE AppInit1 _INIT1
DebOut( "AppInit1" )
RETURN NIL
Karl-Heinz