web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Compilation, P-Code,CIL.

(0) ShareShare
ReportReport
Posted on by 41

Hi All,

I am trying to gain knowledge about  Compilation, P-Code generation and CIL generation in AX. 

With the help of link given below I came to know about the flow among Compile, P-Code and CIL.

   http://axwonders.blogspot.in/2013/04/ax-2012-cil-how-does-it-work.html

But when it comes to practical I am not able to realize which files undergo this process exactly.

I ended up with the questions below:

Assuming a ideal AX client server environment..

1. What is the extension of x++ code where it is located physically when we develop in Morph X environment?

2. What is the source file of compilation and where is it located?

3. As, I know the result of a compilation is P-Code. But where exactly I can locate P-code?

4. Once we generate CIL for P-code, a CIL is generated in ~/XppIL/ folder. But in the same folder structure I can find Source folder where lots of files with .xpp extension are present. So why we have those files in that Folder?

5. How a CIL generator generates P-Code for a given P-Code?

6. Finally, what is significance of .axmodelstore file/ model store data base  in the compilation, CIL generation point of view?

Since I am new to AX, a detailed explanation would help me a lot to gain a good knowledge.

Thanks in advance,

Lalith Varanasi.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    I'll try to answer it, but you'll have to clarify some questions....

    1. What do you mean by "the extension of x++"? Code is store in the modelstore DB and executed on server (X++ and CIL) and client (X++).

    2. What's your definiton of "source file of compilation" and which language are you talking about in this question?

    3. Compiled code is stored in the modelstore database. That's why you don't have to recompile the application when you deploy the whole modelstore.

    4. The the content of /source/ is used fopr debugging - it's the code you see in debugger when you debug CIL.

    5. You probably meant how it generates CIL, not p-code. What exactly do you want to know about it?

    6. CIL compiler reads compiled X++ code (p-code) stored in the modelstore database, generates a CIL assembly and puts it back. No .axmodelstore file is used during compilation.

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    The you just ask about the source itself (which excludes AOT elements) then it is in the ModelElementData and ModelSecurity* tables. The compiled code is in Sources table. .Net CIL-compiled code is in SysXPPAssembly. Based on that on AOS startup you get the application netmodule DLL files in the XPPIL folder, and if debugging is enabled you also get the .xpp sources which can be used to debug when attaching tot he AOS process.

    How is that all tied together is closed code by Microsoft for which we have no access for, since it is an integral part of the AX kernel.

    AXModelStore is just a file-based container from which you can generate another ModelStore database for AX, that contains all AOT elements with their properties, the source and the compiled code as well.

  • Lalith_Sahith Profile Picture
    41 on at

    Hi Martin,

    I had made some justifications to your comments, please address them now :)

    1. I meant just like a java code source file is saved as .java file, I wanted to know how a  "X++ code"  we develop in MorphXIT environment. What would be the extension of the file?

    2. Obviously I am talking/ referring to X++ code. My intention in that question was, what is the file which undergoes compilation?

    5. Yes, you are correct. I wanted to know how CIL is generated.

    6. CIL compiler reads compiled X++ code (p-code) stored in the modelstore database, generates a CIL assembly and puts it back -> Puts it back refers to?.

    Thanks a lot,

    Lalith Varanasi. 

  • Lalith_Sahith Profile Picture
    41 on at

    Hi Martin,

    I had made some justifications to your comments, please address them now :)

    1. I meant just like a java code source file is saved as .java file, I wanted to know how a  "X++ code"  we develop in MorphXIT environment. What would be the extension of the file?

    2. Obviously I am talking/ referring to X++ code. My intention in that question was, what is the file which undergoes compilation?

    5. Yes, you are correct. I wanted to know how CIL is generated.

    6. CIL compiler reads compiled X++ code (p-code) stored in the modelstore database, generates a CIL assembly and puts it back -> Puts it back refers to?.

    Thanks a lot,

    Lalith Varanasi.

  • Lalith_Sahith Profile Picture
    41 on at

    Hi Vilmos,

    Thanks alot for the reply. But I need a some clarifications with respect to your reply.

    1. Where I can find the ModelElementData and ModelSecurity*Tables?

    2. If I include the AOT elements, what tables shall I refer?

    3. You mentioned compiled code is in Sources table. Where exactly is it located?

    4. What is .NET CIL compiled code? can you please explain in detail?

    5. Shall I consider the AXModelStore file as a clone of the ModelStore data base of AX which contains the AOT elements (along with properties), Source code and compiled code as well?

    6. Finally what is the file extension of the source file?

    Cheers,

    Lalith Varanasi.

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    I am not sure why do you insist on seeing file extensions. AX is not like traiditional programming languages, you will find those artifacts only in a relational database with a very complex structure.

    To summarize most of the answers to your question, check the YourAXDBName_model database, it is all in there. To find out more details you may use Google/Bing/your choice of search provider, since this has been discussed and publicly available already.

    Also many of the questions you are asking have answers in the online MSDN documentation, take a look at there first under the AX Development section.

    https://technet.microsoft.com/en-us/library/gg723921.aspx

    https://msdn.microsoft.com/en-us/library/gg839855.aspx

    Do not hesitate to go a couple of levels up on the navigation bar on the left and on the top, and start learning from the highest level by reading through relevant articles.

  • Lalith_Sahith Profile Picture
    41 on at

    Hi Vilmos,

    Of course it looks like I am insisting more on extensions and exact locations. I am new to AX , I am just trying to gain proper knowledge on this environment. As a part of which I started digging deep that's why I had stressed on file extensions etc.,

    Thanks for your time in answering my doubts.

    Cheers,

    Lalith Varanasi.

  • Verified answer
    Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    1+2: You can't expected that all works the same, such as that if some IDE stores code in files, another IDE can't store it in a relational database. Please listen to us and be ready to throw away assumptions that occur to be invalid.

    6: Back to the modelstore database, of course.

  • Lalith_Sahith Profile Picture
    41 on at

    Hi Martin,

    All right, I got you.

    Thanks a lot for the time .

    Cheers,

    Lalith Varanasi.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
GL-01081504-0 Profile Picture

GL-01081504-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans