Hi all,
I have a problem with a CIL compilation in a AX2012 R3 CU13. The error message is the next one:
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Dynamics.Ax.Xpp.ILGenerator.TraverseTable(XmlNode classNode, TypeBuilder typeBuilder)
at Microsoft.Dynamics.Ax.Xpp.ILGenerator.DefineType(XmlNode classNode)
at Microsoft.Dynamics.Ax.Xpp.ILGenerator.GenerateXppModule()
The CIL generator found errors and could not save the new assembly.
Errors: 1
Warnings: 0
After doing some test, I have tried twice the complete usual solution for this kind of CIL errors:
1. Stop AOS
2. Backup and delete XppIL folder
3. Truncate SYSXPPASSEMBLY table in SQL.
4. Start AOS
5. Full Application Compile (No errors)
6. Run FULL CIL
The error message persists. I have read some topics with a similar problem:
https://community.dynamics.com/ax/f/33/t/220041
https://community.dynamics.com/ax/f/33/t/225050
In this two topics, they finally found a duplicate field, but in their error stack they had "at Microsoft.Dynamics.Ax.Xpp.XppTableInfo.AddField(Int32 id, String propertyName, XppPropertyInfo field)", in mine I have "at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)". Does it help to know about what type of element i being duplicate?
Trying to search the duplicate element, we have tried the script proposed in this thread:
https://community.dynamics.com/ax/f/33/t/120387
SELECT count(Name) AS ElementCount, Name FROM ModelElement
where ElementType <> 12 AND ElementType <> 13 AND ElementType <> 14 AND ElementType <> 15 AND ElementType <> 22
AND ElementType <> 23 AND ElementType <> 24 AND ElementType <> 35 AND ElementType <> 36 AND ElementType <> 42
AND ElementType <> 43 AND ElementType <> 66 AND ElementType <> 113 AND AxId <> 0
group by Name having count(Name) > 1
There is no result for this select. We have tried to modify it, but it didn't work for us.
Now, we are empty of ideas. Is there any way to search the duplicated element? How can we know what kind of element is being duplicated or its name?
Thanks all for your help.
*This post is locked for comments