Hi, I created a plugin to be able to connect using serial connection and send commands.
When i try to run the .tapplan file created using this in a operator GUI then getting error that unable to deserialize step.
"2022-08-24 13:40:27.212452 ; PluginManager ; Debug ; Searched 13 Assemblies. [147 ms]
2022-08-24 13:40:27.213300 ; PluginManager ; Debug ; Loaded OpenTap. [348 us]
2022-08-24 13:40:27.213447 ; PluginManager ; Debug ; Loaded OpenTap.Package. [477 us]
2022-08-24 13:40:27.213449 ; PluginManager ; Debug ; Loaded OpenTap.Plugins.BasicSteps. [479 us]
2022-08-24 13:40:27.289026 ; PluginManager ; Debug ; Loaded System.Private.CoreLib. [1.50 us]
2022-08-24 13:40:27.398175 ; Serializer ; Warning ; XML line 4 column 6: Unable to locate type ‘SerialConnection.SerialConnect’. Are you missing a plugin?
2022-08-24 13:40:27.398220 ; Serializer ; Warning ; XML line 4 column 6: Unable to deserialize step.
2022-08-24 13:40:27.400684 ; Serializer ; Error ; XML Line 4: Unable to locate type ‘SerialConnection.SerialConnect’. Are you missing a plugin?"
Can someone please guide on how to use a tapplan file created in a operator GUI.
It seems you are missing some plugin? This kind of error can happen if you develop the test plan while developing your plugin. In this case there will often not be associated it plugin to the type used in the test plan and hence you will not get a warning when trying to load it.
Do you know which plugin package
SerialConnection.SerialConnect belongs to?
yes, the plugin package is already present with the code. The plugin package is the one which gets created when we run the code in Release mode, right? Is there any specific location to place the tap package after building it? right now I have placed the tap package file at the same location as the code location.
Did you install the TapPackage?
yes, tappackage is installed.
SerialConnection.SerialConnect, is that a private class? Does it inherit from ITapPlugin?
Sometimes, if an assembly does not reference any ITapPlugin implementations it does not get registered as a plugin assembly.
yes, its a private class built using Opentap plugin project.
I dont understand what you mean by " Sometimes, if an assembly does not reference any ITapPlugin implementations it does not get registered as a plugin assembly." Can you guide on how to register it as plugin assembly?
OK, that makes some sense.
For OpenTAP to be able to recognize a DLL as a plugin it needs to have some public class implementing ITapPlugin (Recommended) or you can use OpenTapPluginAssemblyAttribute as so:
[assembly: OpenTap.PluginAssembly(true)] // stick this in your AssemblyInfo.cs file.
Note, since the name of the classes are written into the TestPlan, configuration etc. XML files, It is generally best that they are public. Normally you can only change public class names in breaking releases, so this way your users can ensure that if they use an newer (minor/patch) version of your plugin it will still be able to load the XML files.