How does compilation to c# work "under the hood"

ta5ta5 SwitzerlandMember Posts: 1,164
edited 2009-02-09 in NAV Three Tier
Hi
I just try to sort out how the compilation to c# works under the hood.

I mean this:
When an object is stored with compilation in the database, what kind of processes then start to create the c# files for the service tier?
How do the files get to the directory of the service tier and does this also work if more than one service tier is installed for the same db?

Of course I know this is not basic know how but I hope to understand some things better...

Thanks in advance
Thomas

Comments

  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    When you edit your AL code with the Client, the Client will create the C# code and store it in a BLOB in the Object Metadata Table.
    Next time the Service Tier needs that object it will pick up the new C# code - store it in the source folder and compile it into a module and load that.
    So yes - it will work with multiple service tiers.
    If you set the Debug flag in the service tier customsettings.config - then all the C# files will be written in this directory.
    This is why Visual Studio can connect to the service tier process and you can set breakpoints in the code running on the service tier.

    Hope that explained the basics.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • ta5ta5 SwitzerlandMember Posts: 1,164
    Wow, thanks a lot for the detailed explanation. =D>
    Thomas
  • ara3nara3n Member Posts: 9,248
    I just checked and the objects are stored in plain text in cSharp. We can finally track objects changes automatically.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ta5ta5 SwitzerlandMember Posts: 1,164
    Btw:
    Where about is the source folder for the rtc and for the nst?
  • ara3nara3n Member Posts: 9,248
    you can export the blob field from Object Metadata table and you'll see the source code.

    In order to see it in a folder, you need to change the config file to enable debug.

    It then puts it in

    the location in XP where c# is created is in a different folder. It's in

    C:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server

    For vista it puts it in another folder.

    C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\


    http://blogs.msdn.com/clausl/archive/20 ... -2009.aspx
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    Where about is the source folder for the rtc and for the nst?
    Rashed wrote the whereabouts on the service tier - the source code will never find it's way to the Client (RTC) - since no code is executed there.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • ta5ta5 SwitzerlandMember Posts: 1,164
    Thanks for all your answers!
Sign In or Register to comment.