General X++ Development

How do I call .NET/C# code from X++?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I call .NET/C# code from X++?

SSunny Vasty75 reputation · answered Aug 13, 2026

X++ can call .NET types directly when the assembly/type is available.

X++
System.Guid guid = System.Guid::NewGuid();

info(guid.ToString());

For your own .NET assembly, make sure the reference and deployment are correct.

If the .NET call can throw, handle CLR exceptions appropriately instead of assuming every failure will come through as Exception::Error.