topic hubAL Developmentofficial - Microsoftreviewed - checked by Opus

Using .NET (on-premises only)

.NET interoperability from AL in on-premises Business Central: declaring dotnet packages and types, using control add-ins, serializing types, subscribing to events, and migrating from .NET Framework to .NET Standard. It answers how-to and compatibility questions for on-premises deployments only.

Path: Development > Programming in the AL language > Using .NET (on-premises only) · tier official · system development · narrative reviewed (checked by Opus)

Overview

This section covers how AL code works with .NET in on-premises Business Central. It applies only when the deployment target is on-premises. The pages explain how to declare .NET assemblies and types and then use them from AL.

Start with “Get started with Microsoft .NET Interoperability from AL”, which covers dotnet package declarations, assembly references, type aliases and assembly probing paths. From there, the other pages handle specific tasks: using .NET and JavaScript control add-ins, making .NET types serializable between client and server, and handling events from .NET types with DotNet variables.

The migration page is for anyone with existing .NET add-ins. It describes the move from .NET Framework to .NET Standard, the compatibility changes in v21 and v22, and the analysis tools that help check compatibility.

Key points

  • All .NET interoperability from AL requires an on-premises deployment target.
  • Types are declared in a dotnet package with assembly references and optional type aliases, then used in AL code; assembly probing paths control where assemblies are found.
  • Control add-ins are declared with assembly, type and class information, using attributes such as ControlAddInExport and ApplicationVisible.
  • Serializing .NET types between client and server uses SerializableAttribute or the ISerializable interface; NonSerializedAttribute excludes members.
  • Events from .NET types are handled with DotNet variables that use the WithEvents attribute and trigger syntax.
  • The migration guide covers .NET Standard support, a .NET Framework compatibility mode, and the .NET 6.0 runtime, with compatibility changes in v21 and v22.
  • The .NET Portability Analyzer and the ApiPort tool help check add-ins for compatibility during migration.

Learn pages

Videos, posts and code changes

Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 5 Learn pages