25 February 2014

Error 351 when generating full CIL

Lately I had Problems with a newly installed AX 2012 R2 CU7 after compiling with AXBuild I tried to do a full CIL Generation.
This allways results in the following error code 351:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index at
System.Collections.Generic.List'1.get_Item(Int32 index) at Microsoft.Dynamics.Ax.Xpp.ILGenerator.loadFieldsIL(TypeBuilder typeBuilder) at Microsoft.Dynamics.Ax.Xpp.ILGenerator.declareFields() at Microsoft.Dynamics.Ax.Xpp.ILGenerator.GenerateXppModule()

Knowing that when the AOT compiles CIL should also work I tried at first these steps:

  1. stop the AOS
  2. navigate to C:\Program Files\Microsoft Dynamics AX\60\Server\AX2012R2CU7\bin\
  3. rename XppIL Folder to something else
  4. restart AOS
The restart will create XppIL folder again. If that doesn't happen grant the AOS Service user read and write access to the server restart again.

In my case I still got the error. So instead of compiling with axbuild I started a compilation of all tables and classes from the aot. After that I was able to generate full CIL.

So instead of compiling the System with axbuild we should still do a compilation from the AOT when we have a newly installed environment.
Post a Comment