6 Replies Latest reply on Jun 19, 2016 8:57 PM by John Messinger

    Problem in deploying AFSDK based application.

    mdspath

      Hi guys,

       

      I have a problem in deploying the AFSDK based application.

      I have windows 2008 R2 server and have installed PI AF server 2015 R2, PI Server 2012.

      Everything is working fine in the development environment  but when all the dependent files and folder copied to the Virtual machine in cloud, getting the below exception.

      I am sure OSIsoft.PI.Net.Core.dll is present where the exe is. Even this file is found in the gac folder of windows.

      Have proper license also.

       

      System.IO.FileNotFoundException: Could not load file or assembly 'OSIsoft.PI.Net.Core.dll' or one of its dependencies. The specified module could not be found.

      File name: 'OSIsoft.PI.Net.Core.dll'

         at OSIsoft.AF.PI.PIServer..ctor(PIServersGlobal parentCollection, Guid id, String uniqueID, String name, ConnectionEntity connectionEntity, PIServerRoleEntity roleEntity)

         at OSIsoft.AF.PI.PIServersGlobal.LoadServer(DomainTable domainTable, ConnectionEntity defaultConnection, ConnectionEntity connection, IDictionary`2 piserverIDs, Boolean raiseEvents)

         at OSIsoft.AF.PI.PIServersGlobal.Load(Boolean force)

         at OSIsoft.AF.PI.PIServersGlobal..ctor(PISystemsGlobal systems)

         at OSIsoft.AF.PISystemsGlobal.get_PIServers()

         at OSIsoft.AF.PI.PIServersGlobal.GetPIServers(PISystemsGlobal systems)

         at OSIsoft.AF.PI.PIServersGlobal.GetPIServers(PISystems systems)

         at OSIsoft.AF.PI.PIServers..ctor()

         at CRM.OSIPI.OsiAF.Connect()

       

       

      Looking forward for your answer.

      Thanks in advance.

        • Re: Problem in deploying AFSDK based application.
          John Messinger

          Did you perform the installation of the AFSDK using the standard AF Client installer from OSIsoft, or did you only copy referenced files from the development environment? You also mentioned that you installed PI AF server 2015 R2, but made no mention of installing the AF client software. This is required for any AFSDK based application you deploy, as the AF Server does not provide the necessary SDK assemblies.

          1 of 1 people found this helpful
          • Re: Problem in deploying AFSDK based application.
            bshang

            Hi Mike,

             

            I think this is most likely because the client machine does not have AF Client installed. Please note that custom AF SDK applications are only supported if the client machine has an installation of AF Client. It won't be sufficient to just bundle the AFSDK DLL with the application, since the AFSDK DLL has other dependencies installed only with AF Client.

             

            For example, OSIsoft.PI.Net.Core.dll is part of the managed data access (PI Data Archive) component of AF and is installed with AF Client. If it's not installed, then when a deployed AF SDK application wants to make a call to the PI Data Archive and finds the assembly missing, it will throw the FileNotFoundException.

            • Re: Problem in deploying AFSDK based application.
              mdspath

              Hi John,

               

              PI AF Client 2010 R3 v2.4.0.4431 is installed in the VM Machine.

              Am I still missing anything ?

               

              Thanks

                • Re: Problem in deploying AFSDK based application.
                  skwan

                  Mike:

                  Looks like you wrote your code using the .NET 4 version of the AF SDK.  This was not introduced until AF 2012.  Therefore, your VM does not have the proper version of AF Client installed.  In addition, although we try very hard to provide backwards compatibility, you would have the best experience if your AF Server and AF Client are of the same version.  I would recommend you install AF Client 2015 R2 on your VM.

                  --

                  Steve Kwan

                  2 of 2 people found this helpful
                  • Re: Problem in deploying AFSDK based application.
                    John Messinger

                    Hi Mike,

                    As Steve has mentioned, you will need to deploy a later version of the AF SDK on the target VM. PI AF Client 2010 R3 v2.4.0.4431 doesn't include all of the required assemblies listed in your stack trace. As a general rule, you should deploy at least the same version of the AF SDK on the target VM as what is installed on your development system.

                     

                    Regards,

                    John

                    1 of 1 people found this helpful