The CLR for X++ programmers

Dynamics Ax offers since Ax4 a .Net support (BC.Net, EP and CLR objects with X++). As a matter of fact .Net will have a more and more important influence on Dynamics Ax since .Net is the glue of the Microsoft product stack. Sharepoint, BizTalk, SQL Server, Analysis Services, Microsoft Project, Workflow Foundation, … all these products are already communicating with Dynamics Ax due to .Net. So having basic .Net skills is important for you as a Dynamics Ax expert.

Based on problems that partners reported in the last months, I’m going to blog the next weeks about the differences between the Dynamics Ax and the CLR and C#. I hope this might help you to avoid typical errors…

Here are the topics that I will treat in these blogs:

1. The garbage collector in X++ and the CLR

2. Exception handling in .Net and X++

3. Some important things for a X++ developer to know when writing C# code

4. Architecture of applications using the BC.Net

Please send me your comments or suggestions. Perhaps you might have questions that you did not get answered so far. Thank you for any mail/comment!

Comments (4)

  1. wenni057 says:


    I send you my AX wrapper, to my opinion it should take care with these points!E82F2C8CB173C0A0!364.entry

  2. flo2005 says:

    Hello Wenni,

    I’m currently on a training and I’ll be back next week. I’ll have a look at it on Monday.



  3. Dynamics Ax offers since Ax4 a .Net support ( BC.Net, EP and CLR objects with X++ ). As a matter of fact

  4. flo2005 says:

    Hi Wenni,

    You shouldn’t have any ‘memory’-leaks with your code:

    – You’re providing an explicit method to release unmanaged resources.

    – You implemented a way that if the resources haven’t been released until the object is finalized, this will by done by the GC.

    What you are missing in you’re code is to signakize the GC that the Finalize has already been done and that all this Finalization-overhead by the GC shouldn’t be done any more. This is normaly done with the follwowing instruction and is part od the Dispose-pattern:

    8:      public void Dispose()  

    9:      {  

    10:          Dispose(true);  

    11:          GC.SuppressFinalize(this);  

    12:      }

    Line 11 prevents that the object will be passed in the Finalize-heap and consume quite a lmot of resources- for nothing.

Skip to main content