When Multicharts.NET crashes after compiling several C#files

Questions about MultiCharts .NET and user contributed studies.
Posts: 46
Joined: 02 Apr 2013
Has thanked: 11 times
Been thanked: 7 times

When Multicharts.NET crashes after compiling several C#files

Postby HPF » 29 Jul 2013

At the moment, I don't have an isolated test case, and so the following description is rather vague. I nevertheless post it here so people who google the symptoms can find it.

We have several C# classes in seperate files under

c:\ProgramData\TS Support\MultiCharts .NET\StudyServer\Techniques\CS

which are used by a strategy that is attached to a chart. Whenever we edit one of the C# source files using an external editor, MultiChart.NET automatically recompiles the C# and then recalculates the strategy.

After repeating this work flow again and again (perhaps 50-100 times), occasionally MultiCharts.NET crashes (Windows: "This program does not work anymore...."). When this happens, the affected strategy never works again, and as soon as it is attached to a chart and recalculated, MultiCharts.NET crashes.

Here is how we deal with this situation:
1) When you save a workspace, always save it when the strategy is "off" so you can restart MultiCharts.NET even when the strategy has become corrupt without MultiCharts immediately trying to recalculate the strategy and crashing
2) Once MultiCharts.NET has crashed, go to the Windows task manager and manually kill all processes related to MultiCharts.NET
3) The strategy that has caused the crash will never work again. But you can create a new strategy .CS file with a different file name and literally copy the old source code into the new .CS file (don't forget to rename the main class to match the new file name). The new C# class will compile and work without crashing. Finally, you can delete the old strategy in the PowerLanguage.NET editor.

I have a UNIX background, and so I can only guess what's responsible for this behaviour. Obviously, MultiCharts.NET needs to compile the various C# files and then link them into some kind of library, dynamically load the library and call some functions. I guess that there is some error during the linking stage, and some corrupt object code remains in the library. What's corrupt is either associated with a C# file name or with the class name, and recompiling this file/class is not sufficient to fix it. With a new C# file name and class name, however, there is no error.

I am not even sure this is a MultiCharts.NET error - it might even be .NET's fault. This is all I have right now. Should I manage to create a reproducible test case, I'll post it here.

These users thanked the author HPF for the post (total 2):
DruHenry MultiСharts

User avatar
Alex MultiCharts
Posts: 194
Joined: 09 Aug 2013
Has thanked: 43 times
Been thanked: 76 times

Re: When Multicharts.NET crashes after compiling several C#f

Postby Alex MultiCharts » 12 Aug 2013

In case the issue persists, please run the Dumper that is in the attahced file to collect the necessary information for the investigation of the issue.

1. Open the .zip file.
2. Copy the files from the archive to a folder.
3. Run the file, according to the bit of installed MultiCharts (32-bit of 64-bit).
4. Select MultiCharts version.
5. Click Dump.
6. Send the information with the issue description to support@multicharts.com
(1.25 MiB) Downloaded 114 times

Return to “MultiCharts .NET”