Backgroundplugin never initialized

My project has the same structure of “SensorMonitor” and I use Backgroundplugin. But the Init function of Bagroundplugin is never runned in the production server (Corporate 2016 10.0a) but in my test server all run correctly (Corporate 2017 R2 11.2a).

Some details:

In the Init() of Defintion.cs file i create the Bagroundplugin instance as in SensorMonitor.

private List<BackgroundPlugin> _backgroundPlugins;
public override void Init()
{
 
 _backgroundPlugins = new List<BackgroundPlugin> { new SensorMonitorBackgroundplugin() };
 
}

In the SensorMonitorBackgroundplugin class i have:

public override List<VideoOS.Platform.EnvironmentType>TargetEnvironments
{
	get
	{
		return new List<EnvironmentType>(new[] { EnvironmentType.Service });
           }
}

Close() event of the Backgroundplugin runs correctly.

In the EventServer log i have this error:

2018-02-15 9:14:39 UTC+01:00 Error  ESEnvironmentManager     Error during BackgroundPlugin.Init() 'TestVMS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with message: Could not load type 'VideoOS.Platform.Messaging.MessageIdAndRelatedKindFilter' from assembly 'VideoOS.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bc60fba4a7969f89'.
 
Exception details:
 
System.TypeLoadException: Could not load type 'VideoOS.Platform.Messaging.MessageIdAndRelatedKindFilter' from assembly 'VideoOS.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bc60fba4a7969f89'.
 
  at TestVMS.Background.SensorMonitorBackgroundplugin.Init()
 
  at VideoOS.Event.Server.MIP.Environment.ESEnvironmentManager.StartAfterTokenAndConfigurationReady()
 

How do i can to resolve the issue?

First step is to make sure the plugin load. I guess you have verified this in the Event Server log.

If your plugin has the same ID as the sample make sure you do not attempt to run both at the same time.

To debug (quote from MIP Documentation - Getting Started > Plug-in Development):

--

Start Debugging from Visual Studio This Way:

  • Place the compiled DLLs in the folder that is loaded by the application. You may want to make a copy statement in the post-build event command line on the Build-Events tab within Visual Studio.
  • Create a plugin.def file and place it in the same folder.
  • Change Visual Studio project properties for Debug
    • Change the Start external program so that it matches the application that should start (for the XProtect Smart Client it would be Client.exe in the XProtect Smart Client install folder)
  • For starting services, add the command “-x” to the command line. (Make sure the service is stopped before you start the service exe file)

I’ve updated the post with more details that only now I have. I can not get the Init() in the system with Corporate 2016 10.0a while it works with with 2017 R2 11. You can find the error in the main question.

MessageIdAndRelatedKindFilter is something new in 2017R1.

Replace the VideoOS.Platform.dll in the event server with the newer one from your MIP SDK.