8 Replies Latest reply on Dec 3, 2013 8:34 PM by Dag Reppen

    Issues with ANSDK, moving 32-bit application to 64-bit machine

    Dag Reppen

      Hello all,


      I have created a standalone application the reads PI Notifications on my 32-bit machine. I am attempting to transfer this application over to a 64-bit machine, but consistently receive this error when attempting to run it:


      Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException”.


      After shrinking and shrinking my application, I have found that this error is triggered when the application attempts this line of code:


      “ANNotificationList monitoredNotifications = new ANNotificationList(someNotifications);“


      What I realized is that this is the application’s first attempt to use ANSDK (as opposed to AFSDK functions). Are there any known issues with accessing notifications on a 64-bit machine from a 32-bit application? After testing on multiple computers, the program always runs on 32-bit and always crashes on 64-bit.



        • Re: Issues with ANSDK, moving 32-bit application to 64-bit machine

          Hi Dag,


          I haven't found any related known issue in our database.But first have you changed the application to be able to run under Any CPU ?


          Also one related setting I can think of is in PI System Explorer,  under Notifications -> Tools -> Notification Settings -> Global Configuration -> Always Run Notification Service as 32-Bit. You can change the value to False and try again.

          • Re: Issues with ANSDK, moving 32-bit application to 64-bit machine

            Hello Dag,


            Are you compiling on 32 or 64 bit?


            What is the target platform of your project (x86, x64 or any)?


            What products and versions are installed on your development machine and on your 64-bit machine?


            On the 64-bit machine, where is environment variable %PIHOME% and where %PIHOME64% pointing to?

              • Re: Issues with ANSDK, moving 32-bit application to 64-bit machine
                Dag Reppen

                Thank you both for your response.


                Lingli, I have tried compiling to run under all different setups (Any CPU, 32-bit, 64-bit) but no avail. And unfortunately I noticed no improvement when changing "Run Notification Service As".


                Gregor, I compiled on a 32-bit, targeting x66. The products and versions on both machines seem to be the same (Processbook, being 32-bit, is in the Program Files (x86) folder on the 64-bit machine, along with all SDKs).


                I recently rebuilt the application from scratch on the 64-bit machine and it seems to work just fine (an OK workaround, I suppose). However, I am running into what I believe to be a similar issue when using an AFWrapper with Processbook on the 64-bit machine. The wrapper includes similar ANSDK code and when I attempt to run in Processbook, I receive the error:


                "Could not load file or assembly 'OSIsoft.PIAnalytics.SDK, Version=1.0.777.0, [...] The system cannot find the file specified. "


                Rebuilding the .dll from scratch on the 64-bit machine did solve the problem, and I have placed and referenced the PIAnalytics file in just about every place imaginable. I read on a seperate thread that uninstalling and reinstalling Processbook and the SDKs could potentially solve the issue, but wanted to wait and see if there are other options first.


                Thanks again.



                  • Re: Issues with ANSDK, moving 32-bit application to 64-bit machine

                    Hello Dag,


                    With your latest answer you add a new measure which you hadn't mentioned before: PI ProcessBook.


                    Previously you were talking about a standalone application. Can you please elaborate a bit more about what you are doing? To understand what your issue might be we need a better understanding of what's involved.


                    If I am not mistaken, accessing 64-bit library functions and methods from a 32-bit application (like ProcessBook) is at least problematic. If you are creating a ProcessBook add-in, from your latest post I understand that this might be the case, I suggest compiling this add-in for 32-bit.

                      • Re: Issues with ANSDK, moving 32-bit application to 64-bit machine
                        Dag Reppen



                        I apologize, the ProcessBook issue is a seperate from the standalone application (but caused by the same 32/64-bit crossover).


                        I have an Element Relative Display with a text box that essentially says whether or not there is an active notification for that element. I am using an Wrapper add-in on ProcessBook VBA to get access to my Notification Developer tools. This wrapper worked fine on my 32-bit machine, not so much on the 64-bit. I have compiled for "Any CPU" as well as "x86" (32-bit), yet neither have been fruitful. I am able to perform basic functions with the wrapper, simple "string in, string out", but when trying to access a function using ANSDK I receive the aforementioned "Could not load file or assembly..." error.


                        Could there perhaps be an issue with the version of the AF or AN SDKs? I don't see any 32-bit / 64-bit distinction between them in the download center, so I would imagine they should work fine for any compilation, but I'm grasping at straws...