Skip to main content
PI System
AF SDK
Deployment

Solving 'Could not load file or assembly OSIsoft.PI.Configuration' in PI System Applications

Learn why your PI AF SDK application may fail with a 'Could not load file or assembly OSIsoft.PI.Configuration' error and how proper AF Client installation solves it.

Roshan Soni

4 min read

Understanding the 'Could not load file or assembly 'OSIsoft.PI.Configuration'' Error in PI System Applications

When distributing a PI System client application built with the OSIsoft AF SDK, you might encounter the error:

Could not load file or assembly 'OSIsoft.PI.Configuration, Version=1.3.8.0, Culture=neutral, PublicKeyToken=c3309f0734ba2805' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003 (E_POINTER))

This issue often arises when deploying your application to a machine that does not have the correct PI System components installed. Let’s break down the cause and best deployment practices.

Why Can't I Just Copy the DLLs?

Although it's tempting to distribute just your executable and referenced OSIsoft .dll files, the PI System SDKs—both AF SDK and PI SDK—have deep integrations with PI services and dependencies that are installed system-wide (not just in your application's directory):

  • Assemblies like OSIsoft.PI.Configuration are installed in the Global Assembly Cache (GAC) during an AF Client installation—not via standalone DLLs.
  • AF SDK and PI SDK rely on local services and registry entries and cannot be run out of a folder like typical .NET assemblies.
  • PI System Explorer (PSE) is NOT required to run AF SDK applications, but its presence often coincides with a full AF Client install.

What Must Be Installed?

To run any .NET or C# application that uses AF SDK or PI SDK, your target machine must have the AF Client installed. This package comes with all required assemblies (including OSIsoft.PI.Configuration) and registers necessary services and configuration.

PSE can be unselected during the AF Client install if it's not needed, reducing the install footprint. The critical point is that the AF Client—NOT just copied DLLs—must be present.

Where is OSIsoft.PI.Configuration?

  • It lives in the GAC as part of the AF Client installation.
  • It's used internally by other assemblies—if missing, you get assembly load errors.

Key Takeaways and Best Practices

  • Always install the PI AF Client on every machine that will run AF SDK or PI SDK-based applications.
  • Do not attempt to sidestep installation by copying only the application's DLLs.
  • PSE is optional but the AF Client install is mandatory.
  • If you control deployment, include the AF Client installer/walk your users through installation as part of your deployment instructions.

Conclusion

When building and deploying PI System client applications, remember that they require a full AF Client install—not just a folder of DLLs. By following best practices and ensuring proper installation, you’ll prevent errors like 'Could not load file or assembly 'OSIsoft.PI.Configuration' and deliver reliable PI System solutions.


Further Reading:

Tags

#PI-SDK
#.NET
#OSIsoft.PI.Configuration
#AF Client
#GAC
#Deployment

About Roshan Soni

Expert in PI System implementation, industrial automation, and data management. Passionate about helping organizations maximize the value of their process data through innovative solutions and best practices.

Sign in to comment

Join the conversation by signing in to your account.

Comments (0)

No comments yet

Be the first to share your thoughts on this article.

Related Articles

Enhancing PI ProcessBook Trends with Banding and Zones: User Needs, Workarounds, and the Road Ahead

A look at the user demand for trend banding/zoning in OSIsoft PI ProcessBook, current VBA workarounds, UI challenges, and how future PI Vision releases aim to address these visualization needs.

Roshan Soni

Migrating PIAdvCalcFilVal Uptime Calculations from PI DataLink to PI OLEDB

Learn how to translate PI DataLink's PIAdvCalcFilVal advanced calculations—like counting uptime based on conditions—into efficient PI OLEDB SQL queries. Explore three practical approaches using PIAVG, PIINTERP, and PICOunt tables, and get tips for validation and accuracy.

Roshan Soni

Understanding PI Web API WebID Encoding: Can You Generate WebIDs Client-Side?

Curious about how PI Web API generates WebIDs and whether you can encode them client-side using GUIDs or paths? This article explores the encoding mechanisms, current documentation, and best practices for handling WebIDs in your applications.

Roshan Soni