I’m attempting to write a plugin for some 3rd party software that will use the MKV Exporter to export video content from Milestone and have it available in this application.
I have managed to get it working all the way up to the point where I start the export, the code is almost identical to the Export Sample in the Component samples. I’ve tried with both the 2020 R2 and R3 MIP SDK’s and get the same error.
If I use the MIP SDK Show Logs feature I can see why the error is happening but I can’t work out why it’s a problem as all the SDK DLL’s are in the folder.
When I call StartExport after a few seconds it fails with the exception and the error message says Recorder Offline but in the logs it is complaining about the following: Error: VideoOS.Platform.SDK.Export.MediaDataInspector.TrimStartAndEndTime ():Could not open file ‘ToolkitSourcePlugin_mmp.dll or CoreToolkits.dll’!
The Export Sample project works fine, even copying the dll’s from the output of that to my project I get this error.
It is important to use the same dll’s please verify that you build 64 bit and double-check that you have the same dlls all coming from the [C:\Program](file:C:/Program) Files\Milestone\MIPSDK\Bin folder.
The unmodified Export sample works when testing exporting that exact same (same server, same client PC, same user, same time period)?
If yes, can you in any way pinpoint what you might do different?
I can confirm all of the above, I’ve put the Export Sample exe in my release directory just to confirm for sure and it worked.
The server it’s connecting to is the same one and the camera and time period are identical (I’ve double checked the request is UTC in both and is the same).
Because I’m writing a plugin for an application I’ve had to put all the Milestone assemblies into a directory under the location where the plugins go and my plugin implements a custom assembly loader because having the assemblies in the same directory as the plugins caused the 3rd party app to wig out as it tried inspecting them all to be plugins. That side of things seems to be working as I have the Milestone connection dialog, can select a camera, can search for the audio sources etc, it’s just the StartExport method that fails when it tries to do call that method the logs show it failing to call.
I do compile my plugin as 64bit, I think the application is also compiled as 64bit but can’t be 100% certain as it’s not open source and I simply downloaded the binaries. The application is a WPF application.
I’ve ensured that where I’m startimg the export it’s running as STA as I saw others had reported similar issues resolved by this.
I’ve tried using FusionLogs to see what is going wrong and it’s not showing anything, my custom assembly loader (that simply points it at the directory one down called Milestone) doesn’t get invoked to load any extra assemblies after the StartExport is called.
I’ve really drawn a blank on this one as it’s all pointing to that method throwing an exception and that results in the recorder offline exception. If my debugger is attached the the application process I don’t see the exception dialog the application just crashes (and I need to reboot to release the file locks on the files to do a rebuild) but if the debugger isn’t attached it shows the exception dialog with the recorder offline message and pointing me to the line that has the StartExport call.
We suspect that the export loads the dependent dlls late, and when it does it looks for the dependent DLLs in the current folder, and at the time the current folder might no longer be where the Milestone DLLs are located.