PI OData 2015 requires configuration change after installation

Version 1

    We'd like to bring the following issue to your attention. It is also detailed in the KB article below.

     

    KB01224 - PI OData requires configuration change out-of-the-box 

    Issue

    PI OData CTP add-in for PI Web API 2015 may not function properly after a default install without a configuration change.

     

    You will receive a HTTP 500 - Internal Server Error* response with the following exception information:

     

    "Message":"An error has occurred.","ExceptionMessage":"The type initializer for 'System.Data.Entity.ModelConfiguration.Conventions.Sets.V2ConventionSet' threw an exception."
    "Message":"An error has occurred.","ExceptionMessage":"The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application."

     

    *Using the latest Microsoft office tools the error may also include "OData Version"

    Solution

    1.     In the installation folder of PI Web API, typically %PIHOME64%\WebAPI, edit the file OSIsoft.REST.Host.exe.config. Locate the following XML element and remove or comment out:

    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />

     

    2.     Restart the PI Web API service.

     

    Background

    Navigating to the /piwebapi/odata URL works properly and will display configured AF databases as well as links to the Physical and Template models. However, navigating down into the models well result in the error described above. Notably, some Physical model links can be accessed without issue.

     

    Prior to the release of PI Web API 2015, the PI OData CTP add-in was a standalone install package. Merging the CTP with the PI Web API install package resulted in the unintentional inclusion of the SqlClient provider requirement by the Entity Framework. The reference to the SqlClient provider in the configuration file has been removed in the PI Web API 2015 R2 install kit. Please see the PI System Roadmap for the approximate release date.

     

    Please post any questions in the comment section below.