Using proper version control

Proper versioning of source code is an engineering fundamental regardless of development framework, but it is especially important for X++ development. X++ development environments are typically not shared, and production environments only allow compiled source, making version control essential for code management. The effort you invest in properly initializing version control for X++ development up-front will provide a growing value to your team as your project progresses.

Background

X++ developers write code in Visual Studio using a special Dynamics 365 dev tools extension. Most X++ developers work on pre-configured VMs because:

The primary organizational unit of X++ code is an org-specific container called a "model," as described in Models and packages. In the standard Dynamics 365 Finance product, the local source directory structure is organized by model at the highest level. This arrangement is commonly followed in X++ repositories. There are 100+ models in the standard product and usually one or more custom models on an organization's system. Custom models can be produced by Independent Software Vendors (ISVs), Microsoft implementation partners (Value-Added Resellers or VARs), or a customer's development team.

X++ version control has evolved over time. Initially, it was available through a local system integrated directly into the Dynamics AX IDE. Later, it shifted to Team Foundation Version Control (TFVC). Most recently, it has been managed through a Git repository in either Azure DevOps (AzDO) or GitHub.

Considerations

Given the unique factors of X++ development described above, there are several considerations to keep in mind as you begin to configure your X++ repository:

  • Setting up a local Git repository mapping presents a unique challenge when the pre-configured developer VM contains system-standard source code. The mapping expects an empty local directory initially, which creates a special situation that needs to be addressed.
  • The model-based X++ code structure requires a unique repository directory structure when compared to the standard solution structure in .NET languages.
  • The historical product group support for TFVC repository tools can cause confusion for X++ developers trying to manage X++ code using Git. Some Microsoft documentation still indicates that Git is not supported. However, Git has been successfully utilized to manage many X++ development projects.

Guidance

Instructions for the initial configuration of a Git repository for managing X++ development can be reviewed at X++ and Git: A Basic Setup.