CallbackOnCollectedDelegate exception
Posted: Thu Jun 11, 2020 12:46 pm
Hello,
I am getting this exception by using KMotion's interpreter on my application. This happens sometimes and I have not found any pattern to predict it. The same G-Code file may or may not trigger this exception. The problem is that when that happens, the whole program stops and Visual Studio does not mark any code of mine as the problem.
This is the message I get when this happens:
I don't know how to solve this. Has anyone have this problem before?
Thank you.
I am getting this exception by using KMotion's interpreter on my application. This happens sometimes and I have not found any pattern to predict it. The same G-Code file may or may not trigger this exception. The problem is that when that happens, the whole program stops and Visual Studio does not mark any code of mine as the problem.
This is the message I get when this happens:
I found some information about this exception here https://docs.microsoft.com/en-us/dotnet ... legate-mda and it seems that this happens random.CallbackOnCollectedDelegate occurred
Message: Managed Debugging Assistant 'CallbackOnCollectedDelegate' has detected a problem in 'C:\Users\epatec\Desktop\LS-PROCESS-NV\MAIN\LSPROCESS\LSPROCESS\bin\Debug\LSPROCESS.vshost.exe'.
Additional information: Message: A callback was made on a garbage collected delegate of type 'KMotion_dotNet!KMotion_dotNet.KM_CoordMotionStraightTraverseSixAxisHandler::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called.".
I don't know how to solve this. Has anyone have this problem before?
Thank you.