Module for an easy import of CoolProp in VB.Net

At the following link I’ve loaded a Visual Basic module so that it would be easy to import and use the main CoolProps functions in Visual Basic. Indeed, the import modality described on the developer website don’t always work (www.coolprop.org), and in any case it is required a minimum knowledge in C#. With the above linked file, the import procedure is much easier, and, at least in my tests, it works without any issue.

How to use the file

Once the archive content has been extracted, in order for the module to work, it is sufficient to import the CaricaCoolProp.vb file in a Visual Basic project by means of Visual Studio. (Click on the project in in “Solution Explorer” and choose “Add\Existing element”, sorry for the italian pictures, I use Visual Studio in Italian):

The next step is to import the CoolProp dll library, by using the same menu described above. The last step, the easier one, is to setup the DLL copy property. In “Property” set”Build actions” in “Content” and “Copy to Output directory” in “Copy always”. This step is mandatory in order to notify Visual Studio to include the DLL file along with the compiled file.

The DLL I’ve tested is the 64 bit version. Therefore, the project must be compiled as 64 bit architecture, otherwise Visual Studio will trigger an error.

That’s it! The library is now ready and working, as in the following example:

Leave a Reply

Your email address will not be published.