Rubberduck icon indicating copy to clipboard operation
Rubberduck copied to clipboard

Autodesk Inventor 2018 - Unexpected exception thrown in parsing run. An item with the same key has already been added.

Open ls-2037 opened this issue 3 years ago • 0 comments

Rubberduck version information Version 2.5.2.6030 OS: Microsoft Windows NT 6.2.9200.0, x64 Host Product: Autodesk® Inventor® 2018 x64 Host Version: Autodesk Inventor 2018 Host Executable: INVENTOR.EXE

Description The software works correctly when first loaded and refreshed, with 1-2 documents open. If you open 2-3 documents, you get an Unexpected Exception. The log shows the following.

2021-12-08 15:58:47.8572;ERROR-2.5.2.6030;Rubberduck.Parsing.VBA.ParseCoordinator;Unexpected exception thrown in parsing run. (thread 39).;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 Rubberduck.Parsing.VBA.ComReferenceLoading.COMReferenceSynchronizerBase.RefreshReferencedByProjectId()
   at Rubberduck.Parsing.VBA.ComReferenceLoading.COMReferenceSynchronizerBase.SyncComReferences(CancellationToken token)
   at Rubberduck.Parsing.VBA.ParsingStageService.SyncComReferences(CancellationToken token)
   at Rubberduck.Parsing.VBA.ParseCoordinator.SyncComReferences(IReadOnlyCollection`1 toParse, CancellationToken token, HashSet`1 toReresolveReferences)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ExecuteCommonParseActivities(IReadOnlyCollection`1 toParse, IReadOnlyCollection`1 toReresolveReferencesInput, IReadOnlyCollection`1 newProjectIds, CancellationToken token)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ParseAllInternal(Object requestor, CancellationToken token)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ParseAll(Object requestor)

To Reproduce Steps to reproduce the behavior:

  1. Open Inventor and a part/assembly file.
  2. Open the VBA editor.
  3. Refresh Rubberduck.
  4. Close the VBA editor.
  5. Open several other part/assembly files.
  6. Open the VBA editor.
  7. See error.

Expected behavior For Rubberduck to continue working with more than 1-2 open documents.

Logfile Logfile snippet included above.

ls-2037 avatar Dec 08 '21 21:12 ls-2037