xsharp.eu • Program crashed outside VS or XIDE
Page 1 of 1

Program crashed outside VS or XIDE

Posted: Mon Apr 24, 2017 11:33 am
by Juraj
As in x# to find out the procedure and code line on which the program ended in error? As it was in VOError.log in VO

Program crashed outside VS or XIDE

Posted: Mon Apr 24, 2017 1:23 pm
by robert
Juraj

Error handling in DotNet is somewhat different from Error Handling in VO.
In VO there is the concept of a global error handler.
Such as thing does not exist in DotNet.
The closest thing to that would be to setup a try .. catch in your main application loop and then in the catch you can inspect the exception and log it to disk.
The exception will hold the callstack so you can see where the error occurred.
If you want sourcefilename and linenumber in the callstack then you need to include PDB files with your application.
This does not have any effect on the performance of your app, since the pdb file is only used when you inspect call stacks (unless your Vulcan app uses lots of calls to the ProcName() and ProcLine() function, because these functions als use the callstack and retrieve information from the PDB file).

You can also produce a PDB file when you compile in Release mode. On the "debug properties" tab from your project properties you can choose to include 'full' debug information or 'pdbonly'. For apps in release mode I would choose 'pdbonly' and Optimize = true (on the Build tab).

Robert