Error "The given key was not present in the dictionary"


Product(s): SewerGEMS, SewerCAD, CivilStorm, StormCAD, PondPack, WaterGEMS, WaterCAD 
Version(s): 08.11.XX.XX and higher
Area: Modeling

Problem

When computing or opening a model (for a storm or sewer application) or when running a Criticality Analysis (for water applications), the following error message is generated:

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

Solution 1 - If error appears when computing model

Storm / Sewer

A) This may be related to database formatting issues within the Sanitary Loading or Inflow Control Centers.

To Resolve:

  1. Close the model, but leave the program open.
  2. Go to Tools > Database Utilities > Compact Database.

        Note: For the CONNECT Edition series products, this can be found under File > Database Utilities > Compact Database.

  1. Select the database file associated with the model and select Open.
  2. A new dialog will be generated. Select the option to purge the database to save space. (see below snapshot for details)
  3. Once this is completed. Reopen the model and compute it. The error message should no longer occur.

 

B) This may be related to the composite outlet structures.

1) Open the composite outlet structures manager (Components > Composite Outlet Structures)

2) Go one by one to the title of each composite outlet structure and compute it using the compute button.

3) When you locate the structure causing the issue check to see if there are any structures that have the same label name. If there are make them unique from each other.

 

C) This may be related to a conduit using a catalog conduit.

1) Open the conduit FlexTable

2) Add the fields "Conduit Type" and "Size" if they are not already in the FlexTable.

3) Make sure all conduits that have the "Conduit Type" field set to "Catalog Conduit" have the "Size" field populated.

D) This may be related to using an irregular cross section for a conduit or channel, but with an invalid station vs. elevation curve. Open the "collection" for the Irregular Channel Section property and look for any red messages.

In the example below there are two Stations with the same value (0+00), which could be fixed by changing the second one to a "1" (0+01). This should be fixed in a future version (reference #1554725)

WaterGEMS / WaterCAD

A) This error is known to come up when running Criticality Analysis in water products such as WaterGEMS and WaterCAD

1) This can occur for a model with customer meters without an associated element.

2) Check the customer meters present in your model and ensure that they have an associated element (junction or pipe)

Solution 2 - If error appears when opening a model

This may be caused by a corrupt .DWH file.

To Resolve:

  1. Close the model and the Bentley Hydraulic and Hydrology software used to open it.
  2. Navigate to the directory the model is saved to.
  3. Delete the .DWH file.
  4. Open the model.
  5. Reattach all background files.
  6. Save the model.
  7. Close and reopen to make sure the error is gone.