Troubleshooting
Why OSIsoft.PI.Configuration could not load on a client
Short answer
The failure means the target PC has no installed AF Client runtime: OSIsoft.PI.Configuration is part of the PI.Net side of the AF SDK, registered in the GAC and backed by installed local services, so copying AFSDK and OSIsoft.AF.UI.dll beside the executable cannot resolve it. Run the AF Client installer, select the AF SDK feature and leave PI System Explorer deselected; it is not a requirement.
On this page
Your target machine does not need PI System Explorer; it needs the installed AF Client runtime. The startup failure means the .NET loader could not resolve OSIsoft.PI.Configuration, an assembly from the PI.Net part of the AF SDK that is installed in the Global Assembly Cache (GAC), or one of its dependencies. Copying AFSDK and OSIsoft.AF.UI.dll next to the executable cannot fix it, because the SDK reaches the PI Server through installed local services that no file copy creates. Install the AF Client on the target PC, select the AF SDK feature, and leave PI System Explorer deselected when the machine only runs your application.
What the startup message identifies #
Read the whole message before changing anything:
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))
The four parts of the quoted identity, name, version, culture and public-key token, form the complete assembly the runtime requested, so record all of them, not just the file name. OSIsoft.PI.Configuration belongs to the PI.Net portion of the AF SDK and lives in the GAC, the shared assembly store the .NET runtime manages. The GAC is not your application folder, which is why placing the referenced DLLs beside the .exe satisfied nothing. The closing phrase "or one of its dependencies" carries equal weight: an assembly load can fail deeper in the chain than the assembly named first, so a fix that places one file in one folder is not a fix.
Why copying the DLLs cannot work #
AF SDK and PI SDK client applications require an installation. Both use local installed services to communicate with the PI Server, and a copy of the managed assemblies installs no service and makes no shared-assembly registration. That is the whole difference between your two machine classes: the development machine and the machine with PI System Explorer run the application because the AF Client is installed on them, not because of any file your deployment copied. Explorer on a working machine is a marker that the client is installed, not the runtime your code loads. Compiled clients follow the same rule everywhere: an EXE's dependencies need runtime-resolvable paths, so the supported deployment is the installed runtime, not a folder of DLLs.
The deployment decision #
The AF Client kit is one installation: alongside the AF SDK it ships PI Network subsystems (PINS), PI Builder and PI System Explorer, and the installer's feature selection decides which of these land on the machine. Decide by who uses the PC, not by the error text.
| Approach | What the machine gets | Decision |
|---|---|---|
| Copy the .exe and referenced DLLs into one folder | Application files; no services, no GAC registration | Rejected; the AF SDK cannot load this way |
| AF Client install, AF SDK selected, PI System Explorer deselected | The full AF SDK runtime with its local services and registered assemblies | The fix for machines that only run your application |
| AF Client install with PI System Explorer | The same runtime plus the Explorer application | Correct where engineers also browse or edit AF databases |
Your build references the AF SDK, so the AF SDK feature is the non-negotiable part in either install row; Explorer is a convenience for the humans at the machine.
Install the AF SDK runtime in order #
- Save the complete exception text and your build identity, the AF SDK version the project references, before changing the machine.
- Get the PI AF Client setup kit through the manufacturer's official distribution channel. The documented procedure installs PI SDK before PI AF Client; follow the kit's order.
- Run the installer on the target PC and select the AF SDK feature. Deselect PI System Explorer where nobody will use it.
- Complete the installation and apply any restart or service-start instruction the installer shows; clear installer errors before launching anything.
- Deploy your application's own files as a separate step. The installed client is the supported source of the SDK assemblies; stop shipping installer-managed SDK DLLs with the build.
- Launch under the account the operator will use and open the function that actually calls AF or PI, because an empty startup window may not load every dependency.
When the client is installed and it still fails #
If the installed-program inventory already lists an AF Client and the exception persists, the feature set or the installation health is the suspect. Confirm the AF SDK feature was included, since a minimal client install without it reproduces exactly this failure, then run the installer's own maintenance or repair procedure. Dropping OSIsoft.PI.Configuration into the GAC by hand would place one file and still leave the local services absent; it is not a repair. Compare the working and failing machines by installed components and client release, never by folder contents.
Prove the load, then prove the connection #
A clean start proves only that the assemblies resolved. Open the view or operation that exercises AF or PI data and confirm the application log no longer shows the named failure. Server reachability and the operating account's authorization are a separate layer with separate evidence: when an installed client still cannot reach a server, that is a different fault with its own checks, described where an AF SDK application cannot connect on a client machine. The connection code itself is the subject of the native path from a C# application to PI; this page ends at the point where the runtime loads.
Questions asked
Why did a file search for the assembly find nothing on the machine that works?
The assembly sits in the GAC, the shared assembly store the .NET runtime manages, and a desktop file-name search does not list it the way it lists your project folder. Do not use a file search to decide whether the runtime is present. Check the installed-program inventory for the AF Client, or the client's own installation diagnostics, and compare machines by installed components rather than folder contents.
Is PI System Explorer needed on every machine that runs the application?
No. Explorer is a browsing and configuration application that ships inside the AF Client kit, and its feature can be deselected during installation. A working machine having Explorer only tells you the AF Client is installed there; the runtime underneath it is what your application actually loads. Install Explorer where engineers inspect or edit AF databases, and leave it out on operator stations.
Does the E_POINTER code mean the application's pointer handling is broken?
Not in this failure. The 0x80004003 (E_POINTER) text arrives wrapped inside the assembly-load message and disappears once the AF Client runtime is installed. Start editing pointer-handling code only if the identical exception survives a verified, repaired client installation on the target machine. With the runtime missing, your code never ran far enough to pass any pointer.
Which AF Client release should I install?
Match the client release to the AF SDK your build references, using the kit's own compatibility documentation. The version number in the error identifies the assembly the runtime requested, not an installable package, so it cannot pick the kit by itself. Record the client release already running on a working machine with the same application; that pairing is your best-supported target.
Should I keep the copied SDK DLLs in the application folder after installing?
No. Once the client is installed, the runtime resolves the SDK assemblies from the GAC, and the installation is the supported source of them. Shipping private copies of installer-managed DLLs with the build leaves stale files behind after client updates and confuses the next troubleshooting session. Keep the application folder for application-owned files and treat the client installation as the deployment method for the SDK.