System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

This occurs on ‘preview’ option in Milestone Professional Edition in Management Client. However, worked fine in XCoporate Management Client.

When i run video preview plugin sample, i get the error as attached. Parameter is not valid in Professional Edition only.

What version is your XProtect? XProtect Professional version?

What version is your MIP SDK?

Do you do more than load the plug-in? What do you do that trigger the exception?

I use MIP SDK 2017 R1. XProtect Professional version is 2017 R1.

siimply i load the plug-in. When i tried to preview the camera image in XProtect Professional 2017 R1 Management Client, i get this exception in OpenVideo function which uses System.Drawing.dll.

AdminImageViewerControl imgView = ClientControl.Instance.GenerateAdminImageViewerControl();

imgView.OpenVideo(_selectItem1.FQID.ObjectId)

There is no issue in XProtect Corporate 2017 R1 for camera preview.

The difference between XCorporate and XProfessional is XCorporate loads the plugin from 64-bit version where the XProfessional from 32-bit version.

As of now, i have found this.

I am a bit confused in that “System.AccessViolationException” and “Parameter is not valid” must be two different situations.

For me it works.

In the plug-in folder you can have only the plugin.def and the VideoPreview.dll, might you have copied other files from the MIP SDK there?

Yes. i got the same error “Parameter is not valid” in VideoPreview.dll in XProtect Professional. The reason behind the two issues are same i think. Even when i have only one plugin folder for VideoPreview.dll, the issue occurs. Once i get the “Parameter is not valid”, live streaming of video stops in my case. Also, when in “System.AccessViolationException” in my custom plugin, the management client closes unexpectedly.

Please advise me to solve the issue.

.. Even when i have only one plugin folder for VideoPreview.dll, the issue occurs.

One folder yes, and within that folder only Plugin.def and the VideoPreview.dl and nothing else, can you confirm?

What do you do exactly before you see “Parameter is not valid”?

yes. i have only one folder.

i just click start button in videopreview sample and just kept system for an hour opened.

What is in your folder?

Hope this helps you.

I never tried to have the videopreview sample running for an hour. I will try.

Now my guess is that a System.AccessViolationException is not related. It could very well be something triggered by using 64 bit dll on the 32 bit Management Application. My advise is to make sure that you only use 32bit dll (if not “AnyCPU”) when you have your plug-in running in the Management Application.

I tried this too. One help. Can you provide me 32-bit version System.Drawing.dll. I could check.

I am using [C:\Program](file:C:/Program) Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\ System.Drawing.dll for my preview option.

VideoOS.Platform is used from [c:\Program](file:c:/Program) Files\Milestone\MIPSDK\Bin\. Is this correct for XProfessional 32-bit version.

I have build with ‘Any CPU’.

System.Drawing.dll is not a Milestone dll.

What is in the x64 folder (and x86 folder) under your plug-in?

it is dll for SQLLite which i use for database connection.

for my plugin customization.

If you remove it while testing 32 bit does it work better?

no

not yet