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

AF SDK Reference

AF SDK .NET Version Differences

  • Last UpdatedJan 12, 2026
  • 6 minute read
AF SDK .NET Version Differences

Beginning with AF 2024 R2, the AF SDK ships with both a .NET Framework 4.x and .NET 8 version. Feature parity is maintained between the two versions with a few minor exceptions detailed below. Developers should use the supported framework of their choice when creating AF SDK applications unless they need specific functionality for legacy compatibility present only in the .NET Framework version. Both versions of the AF SDK work only on Windows operating systems.

Note Note

The .NET 3.5 version of the AF SDK is no longer distributed or maintained. Please see What's New in PI AF 2018 SP3 Patch 2.

This topic contains the following sections:

Referencing the AF SDK in Visual Studio

Your Visual Studio Project must reference the proper version of the AF SDK.

If your project targets .NET Framework 4.6.2 or later, you must reference the .NET Framework version of the AF SDK located in the directory %PIHOME%\AF\PublicAssemblies\4.0 after AF Client installation. Note that .NET Framework AF SDK is also registered in the Windows Global Assembly Cache.

For projects targeting .NET 8 or later, AF SDK can be referenced using the Aveva.AFSDK package available in the publicly accessible NuGet Gallery (nuget.org). Note that the Microsoft Visual C++ Redistributable must be installed prior to using AF SDK. You can find the latest x64 installer here: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist

Back to the Top

Differences in Functionality

Disparities in functionality between the .NET Framework and .NET 8 versions of the AF SDK are minimal. The differences are described below.

Setup and Configuration

The .NET Framework version of AF SDK is packaged in the AF Client Windows install kit that must be run by a system Administrator at the time of installation. The installation process is responsible for setting up various system folders and configuration files and ensuring proper permissions are in place.

Since the .NET 8 version of AF SDK is only distributed as a NuGet package, there is no installation process. Therefore, some additional configuration is required prior to use.

The only required setup step prior to using the .NET 8 AF SDK is installation of the latest x64 Microsoft Visual C++ Redistributable. If it is not installed or the version installed is older than the minimum required version, users will see a runtime exception indicating the required version was not found. You can find the latest x64 installer here: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist

Additionally, AF SDK utilizes various supporting configuration files. AF SDK will create the necessary folders and files at runtime, but behavior will vary depending on the user’s permissions and the application’s user context. Note that you may choose to run a .NET Framework AF Client installation on the client machine to get the benefit of the installation process even when running a .NET 8 application.

When running a .NET 8 AF SDK application, consider the following configuration details:

  • The following configuration files are required by AF SDK. By default, they will be created in the %PROGRAMDATA%\OSIsoft\AF folder as a system-wide configuration. If the user running the application does not have write access to that location, the files will be created in the user’s %APPDATA%\OSIsoft\AF folder.

    • AFSDK.config - Contains AF SDK global settings as well as the list of known PI Asset Framework servers.

    • PIDataArchiveKST.config - Contains additional settings related to PI Data Archive connections as well as the known list of PI Data Archive servers.

  • The following configuration files are optional, and defaults will be used if not present. Files must be in the %PROGRAMDATA%\OSIsoft\AF folder to be loaded.

    • AFCertificate.config - On a client machine, specifies the certificateMode for TLS cert validation. “AllowExpiredOrRevoked” is used by default.

    • AFTrace4.config - Used to specify custom trace listeners for logging. None are enabled by default.

  • AF SDK uses PlugIns which can be loaded from multiple different locations on the system. The .NET 8 AF SDK NuGet package includes the standard client PlugIns which will therefore be included in the build output of any application using the .NET 8 AF SDK. PlugIns will be loaded from the application directory. If not found there, they will be loaded from the %PROGRAMDATA%\OSIsoft\AF\PlugIns folder provided the user has access to that folder.

When distributing and deploying .NET 8 AF SDK applications, keep the above behaviors in mind and be sure to document any necessary setup for users if non-default configurations are required.

UI Components and Dialogs

The AF SDK UI library containing common components is not available in the .NET 8 version. Furthermore, there are no dialogs for user input or confirmation in the .NET 8 AF SDK. For example, if a user fails to authenticate, they will not see a login prompt dialog.

PI SDK Interoperability

The .NET Framework version of AF SDK contains functionality providing interoperability with PI SDK. Since PI SDK does not have a .NET 8 version, that functionality has been removed in the .NET 8 AF SDK.

Removed methods & properties:

  • AFAttribute.RawPIPoint

  • AFAttribute.RawPIPointPath

  • AFValue.ToPIValue()

  • AFValue.FromPIValue()

  • AFValues.ToPIValues()

  • AFTime.PITime

  • AFTime constructor no longer works with a PITime object

Differences in Data Behavior

Both versions of AF SDK use the same underlying implementations for data handling, but differences between .NET Framework 4.x and .NET 8+ may cause minor differences in how data is processed or displayed. Some of those differences are described below.

TimeSpan precision

In .NET Framework, some DateTime operations are rounded to the nearest millisecond while in .NET 8+ those operations will use full precision. This could result in different results for TimeSpan values returned from AF SDK between the versions beyond millisecond precision.

Floating-point parsing and formatting

Parsing and formatting of floating-point numbers has been improved in .NET compared to .NET Framework resulting in potential differences in display values when displaying values as strings or performing string conversions.

Globalization changes related to string operations

.NET Framework relies on National Language Support (NLS) for globalization functionality while .NET by default uses International Components for Unicode (ICU). There will therefore be some changes in behavior when dealing with string values in AF SDK between the .NET Framework and .NET 8 versions. Specifically:

  • Sort order of strings may differ in cases of non-alphanumeric characters.

  • Zero-weight characters are ignored in some string operations (e.g. null characters, control characters) in ICU but they are not ignored in NLS.

  • Ligature characters that are used to join two letters together (e.g. Æ, Œ, or ß) are not considered equal to their non-ligature counterparts in ICU but they are in NLS.

Note that you can ensure matching behavior by specifying NLS in the runtime configuration of your .NET 8 AF SDK application. See .NET globalization and ICU for details.

Data type support for value serialization/deserialization

BinaryFormatter is removed in the .NET 8 version of AFSDK, so the “EnableBinaryFormatter” AFSDK configuration setting is also removed. Only explicitly implemented/allowed data types can be serialized and deserialized in the .NET 8 AFSDK. If you encounter a value that cannot be read using the .NET 8 AFSDK, you may need to use the .NET Framework version with the “EnableBinaryFormatter” flag set to true.

See Also

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