H5F.create() call throws BadImageFormatException

Open
#144 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp

Research direction

Start by reproducing H5F.create(@"C:\mytest.h5", H5F.ACC_TRUN) in the reported .NET 4.6.1 console application under AnyCPU, x86, and x64 targets on Windows 10 x64. Compare HDF.PInvoke with HDF.PInvoke.NETStandard and establish the supported platform behavior; done means the architecture requirement is fixed or clearly documented.

Written by the indexing model from the issue text.

Description

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).

Dominant language
C#
Stars
87
Forks
32
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HDFGroup/HDF.PInvoke

All issues in HDFGroup/HDF.PInvoke

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.