context-and-oss/XrmContext
53.2
Weak · 3 October 2026
2.5k
lines of production code
F#
with C#
2
measurements over time
What this system is
XrmContext is a command-line tool that generates C\# code from Microsoft Dynamics 365 CRM metadata. It supports flexible authentication methods and allows users to customize the output structure, including multi-file generation and localization. The tool also provides helper classes for handling complex attribute types and tracking entity changes.
Features
Added helper scripts and configuration for XrmContext execution
New files have been added to the repository to facilitate running the XrmContext tool. A PowerShell script (Run.ps1) and a F\# script (Run.fsx) are now available to launch the XrmContext.exe binary. Additionally, an application configuration file (XrmContext.exe.config) has been introduced, containing default settings for the CRM instance URL, username, and password.
files · high confidence
Adds support for Option Set Collections and Delta tracking in XrmExtensions
The XrmExtensions class now includes new methods to handle Option Set Collections (GetOptionSetCollectionValue and SetOptionSetCollectionValue), allowing users to read and write multi-select option set attributes. Additionally, TagForDelta and PerformDelta methods have been added to track attribute changes and update only modified fields during save operations. The code also updates generic constraints to explicitly reference Microsoft.Xrm.Sdk.Entity to avoid naming conflicts.
src/XrmContext/Resources · high confidence
XrmContext CLI now supports multiple authentication methods and advanced generation options
The XrmContext command-line tool has been updated to support flexible authentication, including OAuth, Client Secret, and Connection String methods, with configurable prompt behaviors for MFA scenarios. Users can now control code generation via new arguments: specifying entity intersections, defining label mappings for special characters or naming schemes, setting localization IDs, choosing whether to output a single file or one per entity, and including or excluding entity type codes in the generated output. Additionally, the tool can now save and load CRM metadata to/from local files for offline generation.
src/XrmContext · high confidence
Behavioural changes
Enhanced option set interpretation with localization, label mapping, and metadata expansion
The code generation for entity and option set metadata has been significantly expanded to support richer attribute details and flexible labeling. Users can now configure label mappings to transform option labels (e.g., for emojis or special characters) and specify localization language codes to include localized labels in the generated output. The interpretation logic now captures additional metadata for attributes, including \MaxLength\ for strings and \MinValue\/\MaxValue\ for integers, and correctly handles virtual attributes like MultiSelectPicklists. Furthermore, the system now resolves naming conflicts by appending \\_Enum\ to option set display names if they clash with entity names, and ensures global option sets are correctly identified.
src/XrmContext/Interpretation · high confidence
Expanded CLI arguments and richer metadata model for XrmContext generation
The XrmContext code generator now supports a broader set of command-line options, including new flags for configuration file usage, metadata caching (save/load), and generation control (one-file-per-entity, entity type codes, label mappings, and localization LCIDs). Authentication has been extended to support connection strings, Azure MFA, and client secrets alongside existing methods. On the model side, generated entities now include alternate keys, intersection entity support, and more detailed attribute metadata such as display names, max lengths, and option set localizations, providing a more complete representation of the CRM schema.
XrmContext · high confidence
Expanded CRM authentication options and refactored metadata retrieval
The CRM helper module now supports additional authentication methods, including connection strings, client secrets, and MFA via Azure, alongside the existing username/password and Active Directory flows. Metadata retrieval has been refactored to use a single proxy instance, with updated request flags for fetching all entities and improved handling of entity logical names to ensure they are unique and sorted.
src/XrmContext/Crm · high confidence
Migrated build infrastructure to Visual Studio 2019 and FAKE 5
The project's build system has been updated to target Visual Studio 2019, replacing the previous Visual Studio 2015 configuration. The build script has been refactored to use FAKE 5, which introduces breaking changes in API usage (e.g., \Fake.Core.TargetOperators\ instead of \Fake\) and removes the dependency on Paket in favor of standard NuGet. Additionally, the project now uses AppVeyor for continuous integration, replacing the previous local build scripts.
(repo-wide) · high confidence
Redesigned NuGet package structure and content delivery
The Delegate.XrmContext NuGet package has been restructured to change how its contents are delivered to consumers. The previous installation script (install.ps1) and the command-line helper (getAssemblies.cmd) have been removed. In their place, the package now includes PowerShell (Run.ps1) and F\# script (Run.fsx) files, along with the application configuration (XrmContext.exe.config) and all compiled binaries (\.dll, \.exe) and XML documentation. These files are now deployed to the content\\XrmContext directory instead of the previous tools and content\\bin\\dgtools locations, simplifying the package footprint by bundling dependencies directly rather than relying on external assembly resolution scripts.
nuget · high confidence
Refactored CodeDom generation to use top-level module declarations and added new attribute support
The internal code generation helpers in the CodeDom module have been refactored from nested module structures to top-level function declarations, improving code organization. This change introduces support for generating Range attributes for integer attributes with min/max values, adds OptionSetCollection support for multi-select option sets, and ensures that DisplayName and MaxLength attributes are correctly generated for relevant entity attributes. Additionally, the code now handles deprecated attributes by adding Obsolete attributes and supports sorting entity attributes, relationships, and alt keys by name in the generated output.
src/XrmContext/CodeDom · high confidence
Refactored code generation into modular components with multi-file output support
The code generation logic in src/XrmContext/Generation has been reorganized into distinct modules (DataRetrieval, FileGeneration, Setup, and GenerationMain) to improve maintainability. This refactoring introduces the ability to generate one source file per entity instead of a single large file, controlled by the 'oneFile' setting. It also adds support for label mapping to transform entity labels based on configuration, allows including or excluding entity type codes in the output, and ensures that private entities are ignored during generation. Additionally, the generator now uses a single proxy for fetching metadata and supports top-level module declarations.
src/XrmContext/Generation · high confidence
Refactored command-line argument parsing and added version display
The command-line interface has been refactored to support more flexible argument parsing, including case-insensitive matching and support for alternative argument prefixes (such as hyphens or equals signs). The tool now displays its version number when the help or description command is invoked, and the argument validation logic has been updated to better handle configuration-based arguments and flags.
src/XrmContext/CommandLine · high confidence
Dependencies
Upgrade to .NET SDK-style project and Dynamics 365 v9 assemblies
The XrmContext project has migrated from the legacy .NET Framework 4.5.2 project format to the modern .NET SDK-style project system targeting .NET Framework 4.6.2. This change updates the core Microsoft Dynamics 365/CRM assemblies from version 5.0 to version 9, enabling support for newer platform features. Additionally, the build now explicitly includes FSharp.Core version 4.7 and updates key dependencies like FAKE, Newtonsoft.Json, and the Azure Active Directory client library to their latest compatible versions.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 51 → 53 (+2.3)
- Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.
Lenses
- Code Health 99 → 99 (+0.0)
- Architecture 99 → 100 (+0.3)
- Maturity 29 → 34 (+4.9)
- Readiness 42 → 42 (+0.0)
- Security 98 → 98 (-0.4)
Resolved (2)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
context-and-oss/XrmContext was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 45f39cc9bdd33e723a97c5603f15c88805ac267c — the exact code this score is about.
- Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-4f4226d619ea.