Occasional issue where MC deletes its compiled studies  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
jwebster503
Posts: 24
Joined: 13 Mar 2014
Has thanked: 9 times
Been thanked: 14 times

Occasional issue where MC deletes its compiled studies

Postby jwebster503 » 02 Jan 2015

I have an issue with a custom study which I've now seen on two different computers. My study does reference an external DLL (and before going any further, the reference is made in PL Editor as required!), but I'm not sure that has anything to do with it. The symptom I get is that a red error message is displayed after selecting my study from the list of all studies saying essentially that MC could not load file or assembly C:\ProgramData\TS Support\MultiCharts.NET64\StudyServer\Techniques\CompAssms\(random name)\(same random name).dll.

Here's what happens:
  • 1) In PL Editor, I import my study fresh from archive (known to work, no changes made)
    2) In PL Editor, I make sure the reference is current (sometimes this changes to be pointing at a copy of the DLL made somewhere in the StudyServer\Techniques folder or subfolders)
    3) In PL Editor, I click recompile all.
    4) In a different File Explorer window open to the above listed folder ...\StudyServer\Techniques\CompAssms, I notice a new folder with a random name is created, then within about 2 seconds is deleted again.
    5) In MC.Net, I add a study, select my study from the list, and immediately get the above error saying the file cannot be loaded. The path includes the same random name of the folder seen to appear then disappear in the CompAssms folder.
This has happened to me about once per month, and the way I've worked around it is to restart the computer. After restarting the computer, the change in behavior which gets rid of the error is in step 4 above, the randomly-named folder in CompAssms is NOT deleted (and thus can apparently be found when I load my study).

My questions are:
  • 1) Is there an easier workaround to kick MC to stop deleting its compiled files, because it's a hassle to restart the computer?
    2) How can I prevent this from happening?
    3) Have others seen this behavior?
Thanks,

Jeff

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Occasional issue where MC deletes its compiled studies  [SOLVED]

Postby Henry MultiСharts » 05 Jan 2015

Hello Jeff,

It looks like StudyServer.NET.exe was not finished after the previous session. After you close MultiCharts/PowerLanguage .NET editor - please make sure that all of the processes are finished before starting it again.

User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Re: Occasional issue where MC deletes its compiled studies

Postby orad » 06 Feb 2015

You can open PowerShell and run the following to close all MultiCharts processes:

For MC 32-bit:

Code: Select all

Get-Process | where Product -eq "MultiCharts" | Kill -PassThru
For MC 64-bit:

Code: Select all

Get-Process | where Product -eq "MultiCharts64" | Kill -PassThru
For MC.NET 32-bit:

Code: Select all

Get-Process | where Product -eq "MultiCharts .NET" | Kill -PassThru
For MC.NET 64-bit:

Code: Select all

Get-Process | where Product -eq "MultiCharts .NET64" | Kill -PassThru

User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Re: Occasional issue where MC deletes its compiled studies

Postby orad » 20 Aug 2016

Looks like in newer builds of MultiCharts the "Product" property of the MC processes are not set anymore, so the PowerShell command I gave above won't work anymore. With process properties we could easily filter out all MC processes with a command like this:

Code: Select all

Get-Process | where Product -like MultiCharts*
This is a minor regression but it's breaking some of my scripts.


Return to “MultiCharts .NET”