How to incorporate epanet2.dll file into an .exe program?

I wrote a program in VB.net using VisualStudio2012 which uses the epanet2.dll file.
In my computer, the software runs perfectly, but when I run the program on a computer without the Epanet error occurs.
I tried to add the file to epanet2.dll program (Project >> Add Reference >> Browse), but also occurs error.
My software was developed using Windows Form Application (where call some functions of Epanet) and Module (where Epanet variables are declared).
When I compile the program, epanet2.dll file is not incorporated.
Could anyone help me?
Thank you.

If you want to make use of EPANET functions in your own program, you can either

a) build and distribute the EPANET engine as a DLL (a dynamically-linked library) then distribute both your program and the DLL (two separate files; easiest for your program to find the DLL if it’s in the same directory). When compiling your program (depending on the language you use), you may need to point your compiler at the EPANET toolkit ‘header’ file, which tells it what’s defined in the DLL and allows it to check that you’ve tried to call EPANET functions in a valid way.

b) build EPANET as a ‘static library’, which allows you to compile a single executable containing both your code and this library.

Is there any reason you can’t stick with option (a) and just ship the EPANET DLL with your VB application?

1 Like