CIL generation: Index was out of range. Must be non-negative and less than the size of the collection


Problem: Recently, I installed one of the model files from an ISV and everything went fine in DEV environment. I replicated the same process in UAT environment for installation and installed the model files. After which I ran the full application compile, database synchronization and then full CIL. The full CIL failed because of following error:
CIL generation: Index was out of range. Must be non-negative and less than the size of the collection
Solution: I could fix this problem by following steps:
Since there were no compilation errors in full application compile, I was sure that there are no errors in the application. The system was not able to pick some assemblies so I compiled the Tables manually and then classes. After which, I put the application on full CIL again and it worked fine.
 
 
when you open the CIL log file the below error message shown,
Note: CIL log file path is "C:\Program Files\Microsoft Dynamics AX\60\Server\YOUR_INSTANCE\bin\XppIL\Dynamics.Ax.Application.dll.log
 
Finished pass 1 at 10/01/15 12:50:58 PM
Finished pass 2 at 10/01/15 12:52:47 PM
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()
The CIL generator found errors and could not save the new assembly.
Errors: 1
Warnings: 0

Comments

Popular posts from this blog

x++ code to Generate cheque for vendor payment journal

Import Procurement Hierarchy / Categories with out code in ax 2012

Copy favorites From one user to another user - Ax 2012