Using HDF.PInvoke in VS2010

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using HDF.PInvoke in VS2010

Jager, Gerco de

Hi all,

 

I’m using HDF5 and HDF.PInvoke for the first time. Our company is heading towards HDF5 as default container for sharing our measurement datasets. This requires among other things a .NET library to ensure our HDF5 conventions.

 

On nuget I found the HDF.PInvoke package which is the way forward. I hoped for a plug-and-play-experience adding it to my Visual Studio 2010 project but alas, I don’t seem to get it working.

I get a BadImageFormatException using the 1.10 version. If I downgrade to the latest 1.8 version then the objects in the library cannot be found.

(On this machine I have also a python environment with h5py and hdf5 v1.8.15; on my home pc using VS 2015 without h5py I get a dll import exception, ‘hdf5.dll’ missing.)

 

On support.hdfgroup.org I could not find much information about how to set up a development environment, such as what needs to be additionally installed to use the HDF.PInvoke nuget package and which C# project settings and dependencies are needed to successfully build and run tests.

I probably overlooked it, but I’m looking forward to such information.

 

Kind regards,

 

Gerco de Jager

 

 


Gerco de Jager | Software Engineer | MARIN Software Group
MARIN | T +31 317 49 33 51 | [hidden email] | www.marin.nl

LinkedIn YouTube Twitter Facebook
MARIN news: Seminar 10 jaar Platform Schone Scheepvaart, 6 september, Rotterdam


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|

Re: Using HDF.PInvoke in VS2010

Gerd Heber

Gerco, the NuGet package brings its own native dependencies (hdf5[_hl].dll,

szip.dll, zlib.dll) You probably have multiple copies of hdf5[_hl].dll for

different architectures in your PATH. Do a search for hdf5.dll in explorer

and try (for a sanity check) to eliminate them from your PATH environment variable.

The BadImageFormatException means that you are trying to load

a 32(64)-bit version into a 64(32)-bit process, which won’t fly.

 

G.

 

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Jager, Gerco de
Sent: Tuesday, August 29, 2017 8:09 AM
To: [hidden email]
Subject: [Hdf-forum] Using HDF.PInvoke in VS2010

 

Hi all,

 

I’m using HDF5 and HDF.PInvoke for the first time. Our company is heading towards HDF5 as default container for sharing our measurement datasets. This requires among other things a .NET library to ensure our HDF5 conventions.

 

On nuget I found the HDF.PInvoke package which is the way forward. I hoped for a plug-and-play-experience adding it to my Visual Studio 2010 project but alas, I don’t seem to get it working.

I get a BadImageFormatException using the 1.10 version. If I downgrade to the latest 1.8 version then the objects in the library cannot be found.

(On this machine I have also a python environment with h5py and hdf5 v1.8.15; on my home pc using VS 2015 without h5py I get a dll import exception, ‘hdf5.dll’ missing.)

 

On support.hdfgroup.org I could not find much information about how to set up a development environment, such as what needs to be additionally installed to use the HDF.PInvoke nuget package and which C# project settings and dependencies are needed to successfully build and run tests.

I probably overlooked it, but I’m looking forward to such information.

 

Kind regards,

 

Gerco de Jager

 

 


Gerco de Jager | Software Engineer | MARIN Software Group
MARIN | T +31 317 49 33 51 | [hidden email] | www.marin.nl

LinkedIn YouTube Twitter Facebook
MARIN news: Seminar 10 jaar Platform Schone Scheepvaart, 6 september, Rotterdam


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|

Re: Using HDF.PInvoke in VS2010

Jager, Gerco de

Hi Gerd,

 

Thank you for pointing this out and responding so quickly. I’ve got it working on both VS 2010 and 2015. J

 

Instead of hacking PATH (which content is controlled by our IT-department) I am using a post-build event to copy the binaries to the output folder.

 

Kind regards,
Gerco

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Gerd Heber
Sent: dinsdag 29 augustus 2017 15:38
To: HDF Users Discussion List
Subject: Re: [Hdf-forum] Using HDF.PInvoke in VS2010

 

Gerco, the NuGet package brings its own native dependencies (hdf5[_hl].dll,

szip.dll, zlib.dll) You probably have multiple copies of hdf5[_hl].dll for

different architectures in your PATH. Do a search for hdf5.dll in explorer

and try (for a sanity check) to eliminate them from your PATH environment variable.

The BadImageFormatException means that you are trying to load

a 32(64)-bit version into a 64(32)-bit process, which won’t fly.

 

G.

 

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Jager, Gerco de
Sent: Tuesday, August 29, 2017 8:09 AM
To: [hidden email]
Subject: [Hdf-forum] Using HDF.PInvoke in VS2010

 

Hi all,

 

I’m using HDF5 and HDF.PInvoke for the first time. Our company is heading towards HDF5 as default container for sharing our measurement datasets. This requires among other things a .NET library to ensure our HDF5 conventions.

 

On nuget I found the HDF.PInvoke package which is the way forward. I hoped for a plug-and-play-experience adding it to my Visual Studio 2010 project but alas, I don’t seem to get it working.

I get a BadImageFormatException using the 1.10 version. If I downgrade to the latest 1.8 version then the objects in the library cannot be found.

(On this machine I have also a python environment with h5py and hdf5 v1.8.15; on my home pc using VS 2015 without h5py I get a dll import exception, ‘hdf5.dll’ missing.)

 

On support.hdfgroup.org I could not find much information about how to set up a development environment, such as what needs to be additionally installed to use the HDF.PInvoke nuget package and which C# project settings and dependencies are needed to successfully build and run tests.

I probably overlooked it, but I’m looking forward to such information.

 

Kind regards,

 

Gerco de Jager

 

 


Gerco de Jager | Software Engineer | MARIN Software Group
MARIN | T +31 317 49 33 51 | [hidden email] | www.marin.nl

LinkedIn YouTube Twitter Facebook
MARIN news: Seminar 10 jaar Platform Schone Scheepvaart, 6 september, Rotterdam


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5