WaterObjects.NET error: Could not load file or assembly

  Product(s): WaterObjects.NET
  Area: Other


WO.NET error when running a sample model: Could not load file or assembly ...

For example:

Could not load file or assembly 'Haestad.SQLite, Version=, Culture=neutral, PublicKeyToken=b4db808388021f6e' or one of its dependencies. An attempt was made to load a program with an incorrect format


To resolve this, be sure to match the target platform to the program file location. In addition, make sure to move the .EXE file into the installation folder for the program, such as WaterGEMS. This will allow the field to be populated. Alternatively (for example if you do not have permission to copy to the installation folder), copy the required DLL files from the installation folder, to the folder where your project resides:

  1. Make note of the platform you are building in Visual Studio.  This will either be x86 and x64.  This is typically to the right of the configuration (Release or Debug).
  2. If you are building x86:
    1. Copy all files and folders from C:\Program Files (x86)\Bentley\WaterGEMS to the output folder (typically bin\x86\Debug or bin\x86\Release). 
    2. When prompted to overwrite, select "Skip these files"
  3. If you are building x64:
    1. Copy all files from C:\Program Files (x86)\Bentley\WaterGEMS\x64 to the output folder (typically bin\x64\Debug or bin\x64\Release).
    2. When prompted to overwrite, select "Skip these files".

See Also


Licensing error with Waterobjects.NET project due to Licensing changes