I have been working on setting a new DOM module. I imported a test version of my model using the Excel sheet and Dom Designer automation script. After making some changes, I wanted to start over, so I deleted the module using the Dom Editor and tried to re-create it, but now I get the error:
System.ArgumentException: An item with the same key has already been added.
Any thoughts on how I can track down what key is already there? Or, better, how do I get rid of it?
Thanks!
Hi Jamie,
In the Client Test tool, you can go to:
- Advanced>App>DataMiner Object Model...
There you should get an overview the different DOM modules you have.
If you then select a particular Module, and Click on view, you can then navigate to the "SectionDefinitions" tab, and again View this. Then you should get an overview of the Fields which are in the Definition. If you would compare this to the information that you are currently trying to recreate you might spot the key which is already in there.
Note that instead of the "Dom Designer" Script, there is also a "Dom Editer" Script. This script allows you to easily Edit your Dom module.
If you would require this script, this can be provided to you.
Kind regards,
For reference, here’s a more complete version of the error in the logs:
2023/01/19 22:57:03.444|SLAutomation.exe 10.2.2241.34|10564|66008|CScriptLoader::ExitNow|DBG|-1|[James Stutz] (Script Dom Designer) EXIT: “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 Script.Run(Engine engine)”