4 Replies Latest reply on Feb 21, 2018 1:19 PM by gregor

    AF SDK losses reference


      hi all

      Has a service using PI SDK but lately migrated it to use AF SDK with FRAMEWORK 4.0 and while coding all looks good with intellisence and all but once I start building it looses reference and end up with warnings and doe snot build. any clues would be appreciated please




        • Re: AF SDK losses reference
          Rick Davin

          Hi Prabhakar,


          Anytime a build fails, Visual Studio will list any code lines as being in error or warning.  You would need to review and correct those specific errors.  If you have difficulty understanding the error, you could post the specific error message here.  While the big-picture problem is understood in your post, it lacks sufficient detail to provide concrete solutions.

          1 of 1 people found this helpful
            • Re: AF SDK losses reference

              Hi Rick, thanks for the reply it did help. I searched fixed the issues as AF-SDK was .NETFramework, version=4.0 and my service was built against “.NETFramework,Version=v4.5.2” framework. This was throwing “Reference could not be resolved”.


              The simplest workaround is to edit the modeling project file to ignore target framework version mismatches as follows: 

              1. Unload the modeling project by right clicking on it in Solution Explorer window and choosing Unload Project
              2. Open the project file into the editor by right clicking on it in Solution Explorer window and choosing Edit projectname.modelproj
              3. Add the following element inside the <Project> element: 




              1. Save the project file.  
              2. Right click on the modeling project in Solution Explorer and choose Reload Project
              3. Validate your architecture in the usual way.



              2 of 2 people found this helpful
                • Re: AF SDK losses reference
                  Rick Davin

                  That's good news, Prabhakar.


                  I have marked your own reply as the correct answer.  Whenever PI AF is released, there should be Release Notes accompanying it, and it will let you know which .NET Framework to target in your applications.  As you discovered, right now it is .NET 4.5.2.  Future AF versions may require a minimum of .NET 4.6.2 or even 4.7.1.  Again, check the Release Notes.


                  Now that you are past the Build stage, the next possible errors to arise may either be logic errors in your code, or null reference exceptions.  We will be glad to help you with either of those, so come back when here you get stuck.


                  Good luck.

                  • Re: AF SDK losses reference

                    Hello Prabhakar,


                    I am happy you found a solution for your problem but my first reaction on your workaround was confusion and confusion persists.


                    The framework version which a .NET library was built against usually marks the minimum target framework version. With other words, there shouldn't be any issue building against .NET Framework 4.5.2 with AF SDK and I like to clarify this usually isn't an issue.


                    Until today, I never saw a projectname.modelproj in any of my Visual Studio projects.

                    I was also confused by what you identified as the most simple workaround. I am used to modify the .NET Framework target version within the properties of my .NET project.


                    I did some research with the information you shared and found your service might be a Unified Modeling Language (UML) project or you are using component diagrams in your project. Can you help me to understand why my Visual Studio projects are without projectname.modelproj?


                    I found this resource and after reading your post, it looks very familiar. The question for the Visual Studio version appears to be key. Can you share what Visual Studio version you are using?