Harness proD API Help
In This Topic
    Compatibility
    In This Topic

    There are four possible scenarios, which might happen during a new Harness proD release:

    1. No incompatible change – Release Notes will contain information that the current release API is fully compatible with the previous version. No action is required.
    2. Change in Harness proD which is incompatible with older versions of API. Release Notes will contain information that the older versions of API are not compatible with this version of HpD. Standalone applications will have to be rebuilt against the new version of API. Plugins will continue to work without change.
    3. Change in API which is incompatible with previous API releases. Release Notes will contain information that the older versions of API are no longer supported. Plugins will have to be rebuilt against the latest API, Pluings and PluginsCore DLLs. Standalone applications will continue to work as before.
    4. Combination of 2 and 3 – incompatible changes in both API and Harness proD. Both applications and plugins need to be rebuilt.

     

    Upgrade process

     

    With each new version of Harness proD the API version is also incremented. Since the API checks the version of Harness proD it is connecting to, it might be necessary to update the plugins and standalone applications to work with the new Harness proD version.

    Standalone application

    When building the application use the following project settings:

    Note:

    • It is not necessary to rebuild the application for every new version (update, service pack) of HpD.
    • Last supported version of HpD which the current version of API.dll supports is accessible through property: HpdApi.ApiCompatibilityVersion.
      (Checked by API – API refuses to load older Harness proD.)
    • Last supported version of API with current version of Harness proD is mentioned in Release Notes.

    If the application is trying to load Harness proD version lower than the HpdApi.ApiCompatibilityVersion, you get the following HpdApiVersionException:

    If the application is trying to load Harness proD, which is no longer compatible with current (used) version of API.dll, you get the following HpdApiVersionException:

    Plug-in

    When building the plug-in use the following project settings:

    • Add references to the required API DLLs (API, PluginsCore and Plugins)
    • CopyLocal = False
    • Solution Platform = x64

    It may not be necessary to rebuild plugin for every new version of Harness proD (see Release Notes).

    If the plugin references API of version which is older than this minimum supported version, you get an exception when adding the plugin in Settings or when starting Harness proD Studio, if the plugin was already added before:

    No error but plug-in cannot be added in Harness proD Studio

    If no error message occurred but the plugin was not added in settings, check the log. If you see following error in the log, you still loaded the old DLLs from plugin’s context (CopyLocal was set to True).

    Failed to load/initialize „MyPlugin“ from „path to MyPlugin.dll“
    ERROR: InvalidCastException
    Unable to cast object of type MyPlugin to type ‘EPLAN.Harness.API.Plugins.IHpDPlugin’.