5 Replies Latest reply on Feb 13, 2018 5:06 PM by David Hearn

    AF Client sometimes doesnt refresh base plugin dll

    houskat

      Hello,

      I have problem with AF plugins, when upgrading them to a higher version.

      What I am doing to do it right:

      • new assembly contains higher version number
      • i am deregistering the old dll first and then register the new
      • I am registering all the assemblies (aka CustomDataReference1.dll , CustomDataReference2.dll, Base.dll with /owner CDR1 and again Base.dll with /owner CDR2)
      • I am using /owner parameter when registering, to be sure, that AF server knows the dependencies.

      But sometimes the client machine refuses to update its plugin folder and it is needed to delete "C:\ProgramData\OSIsoft\AF\PlugIns" to force the update of the plugins.

      This is happening to base dlls usualy.

      Any sugestions how to handle this? I am prepared to implement a static method in Base.dll, which will periodicaly check the dll versions at server and when it detects frozen version at client, it shows a MessageBox with message to delete AFPlugins cache.

      I dont like this solution, I would prefer something more automatic and more clean. Something like "PISystem.Refresh()", which would check the assemblies version at server and downloads them if needed.

        • Re: AF Client sometimes doesnt refresh base plugin dll
          Mike Zboray

          I don't know what the issue is, but one thing that seems wrong is that you say you are registering Base twice with with two different owners. AFAIK a support assembly can have only one owner. The second registration of Base.dll is overwriting the first.

          1 of 1 people found this helpful
            • Re: AF Client sometimes doesnt refresh base plugin dll
              David Hearn

              Mike is correct, you cannot have the same support assembly for two different plugins. You can see this by selecting your plugin in the 'Plug-Ins' tab of the PI AF Servers property page, right-clicking, and select properties. This will list your registered plugin assembly and any associated support assemblies. When you register the second plugin with the same support assembly that was previously registered, it updates the owning plugin assembly and is no longer associated with the first plugin assembly.

               

              Your best option is to include all your plugin implementations in a single assembly. A plugin assembly can implement many plugin implementations. You could also decide to include the base code in the same single plugin assembly or leave it as a support assembly.

              2 of 2 people found this helpful
                • Re: AF Client sometimes doesnt refresh base plugin dll
                  houskat

                  But that is impossible, when I am using third party dlls. Does it mean, that base class implementations or interface assemblies (which will be referenced by many plugins) are not supported in PI AF Plugins? (I am asking so stupid, because I cannot believe, that this is true. It is the core design in code reusability and clean solution for projects.)

                    • Re: AF Client sometimes doesnt refresh base plugin dll
                      David Hearn

                      You can still use 3rd party DLLs and have them as support assemblies, but you would put the implementation of all of your plugins using that 3rd party DLL into a single plugin assembly. There are a lot of complications with managing versioning of assemblies between different versions of AF SDK and AF Servers that would become even more complicated with attempting to manage support assembly versioning. For example, what do you do when plugin1 uses supportDLL version 1.0 and plugin2 uses supportDLL version 2.0?

                      1 of 1 people found this helpful