Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H5F.create() call throws BadImageFormatException #144

Open
abrasat opened this issue Jun 8, 2018 · 1 comment
Open

H5F.create() call throws BadImageFormatException #144

abrasat opened this issue Jun 8, 2018 · 1 comment

Comments

@abrasat
Copy link

abrasat commented Jun 8, 2018

A VS 2017 console application (.NET 4.6.1 as target framework) running on a Windows 10 x64 PC throws following exception at call of the H5F.create(@"C:\mytest.h5", H5F.ACC_TRUN) method, if application built with the AnyCPU (or x86) option as platform target:

BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

It seems to work ok if application built with x64 as platform target.
Is this a normal behaviour?

Later edit: I tested my application also with HDF.PInvoke.NETStandard library instead of HDF.PInvoke. It has the same behaviour for AnyCPU, but it works with x86 (and x64).

@raghu-iitm
Copy link

raghu-iitm commented Jul 6, 2018

In my case H5F.create() resulted in the following error.
'H5P.FILE_ACCESS' threw an exception of type 'System.TypeInitializationException'
The inner exception shows
"The type initializer for 'HDF.PInvoke.H5DLLImporter' threw an exception.".
I believe the issue is coming from the function GetHid. I am not sure how to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants