Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AF SDK Configuration Files

  • Last UpdatedNov 18, 2025
  • 5 minute read
AF SDK Configuration Files

This topic explains the AF SDK configuration files, their locations, required permissions, and important considerations for users.

This topic contains the following sections:

Configuration files used in AF SDK

AF SDK uses the following configuration files:

FilenameGlobal Default LocationUser Override AllowedUser LocationDescription
AFCertificate.config%PROGRAMDATA%\OSIsoft\AFNoN/A Contains information and settings related to the TLS certificate. On client machines, it is only used to define the certificate validation mode.
AFSDK.config%PROGRAMDATA%\OSIsoft\AFYes%APPDATA%\OSIsoft\AFContains various AF SDK settings including connection and authentication settings, cache settings, and the list of available PI Systems.
AFTrace4.config%PROGRAMDATA%\OSIsoft\AFNoN/AUsed to enable custom trace listeners to be used with AFTrace.
PIDataArchiveKST.config%PROGRAMDATA%\OSIsoft\AFYes%APPDATA%\OSIsoft\AFA list of available Data Archive services as well as connection and authentication settings.
Note Note
For user overridable files, creating a configuration file in the indicated User Location will result in that file being loaded by AF SDK instead of the global configuration file. Any configurations in the global file will be ignored.

Automatic file creation and folder permissions

During a typical AF Client installation (.NET Framework version), the necessary default folder locations and required permissions are automatically set, and the necessary configuration files are created. This setup is not established when using the AF SDK NuGet package without a prior AF Client installation. Therefore, it’s important to understand how AF SDK handles configuration files, including where they are located, how they are created, and what permissions are required.

If the necessary configuration files do not already exist, AF SDK will create them automatically at runtime. For both AFSDK.config and PIDataArchiveKST.config, the logic for file creation is as follows:

  1. AF SDK will begin by looking for an existing configuration file in the current user's %APPDATA%\OSIsoft\AF folder. If the file exists, it will use this file.

  2. If the file is not found there, AF SDK will look for an existing global configuration file in %PROGRAMDATA%\OSIsoft\AF folder. If it exists, it will use this file.

  3. If the file is not found in either location, AF SDK will attempt to create a configuration file in the default location %PROGRAMDATA%\OSIsoft\AF folder.

  4. If AF SDK is unable to create a file in the default location, it will create a file in the user's %APPDATA%\OSIsoft\AF folder.

Important note Important
To avoid automatic creation of user override configuration files, ensure that all users of AF SDK applications on the machine have read and write access to the %PROGRAMDATA%\OSIsoft\AF folder and any existing configuration files. If this is not configured prior to running an AF SDK application, a user override configuration file will be created automatically. Delete any user override configuration files if you intend to use the global configuration.

User overrides

Both AFSDK.config and PIDataArchiveKST.config may be overridden by a user-level configuration file placed in the user's %APPDATA%\OSIsoft\AF folder. As described in Automatic file creation and folder permissions, this may occur automatically if the user has restricted access to the default global configuration file location. A user may also choose to manually create a new configuration file override. User overrides completely replace the global configuration file. It is not possible to create a partial configuration to override only a subset of the settings.

An example of when a user may want to create an override configuration is if they want to set a different default Data Archive server for themselves while leaving the global default server the same for other users on that machine.

Behavior with insufficient permissions

If a user does not have permission to write data to the default configuration file location and the configuration files do not already exist, the behavior is as follows:

  • AFSDK.config & PIDataArchiveKST.config: A user override configuration file will be created automatically, as described in Automatic file creation and folder permissions.

  • AFTrace4.config: AF SDK will attempt to create a default trace file. If creation fails due to insufficient permissions and tracing is enabled, a trace message will be written. This does not impact AF SDK's functionality.

  • AFCertificate.config: AF SDK will attempt to create a default file. If creation fails due to insufficient permissions and tracing is enabled, a trace warning will be written. AF SDK will default to the certificate validation mode AllowExpiredOrRevoked.

Note Note
A user with read permissions to the global configuration files will not automatically have override configurations created for them. Instead, the global files will be used and the user will see access denied errors when attempting to modify configurations.

AFPlugin permissions and fallback behavior

Although AF Plugins are not AF SDK configuration files, there is some overlap with expected user permissions and fallback behavior. This makes them relevant in this context and worth mentioning here for awareness.

In existing AF Clients and AF SDK .NET Framework versions, plugins are stored in the %PROGRAMDATA%\OSIsoft\AF\PlugIns folder. The .NET 8 NuGet package version of AF SDK has some differences in behavior for plugins:

  1. Standard plugins are included in the NuGet package and will be included in the output folder of the AF SDK application at build time. As a result, the .NET 8 version of AF SDK will load plugins from the executing application folder.

  2. If not found in the application folder, AF SDK will attempt to load plugins from the %PROGRAMDATA%\OSIsoft\AF\PlugIns folder.

  3. As before, if the server has a newer version of the plugin or if the local machine does not have the plugin, it will be downloaded from the server.

    a. Downloaded plugins will be stored in the %PROGRAMDATA%\OSIsoft\AF\PlugIns folder.

    b. If the user does not have permission to write to that folder, AF SDK will fall back to a temporary folder.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in