Skip to content

Py.GIL System.BadImageFormatException: An attempt was made to load a program with an incorrect format #476

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

Closed
EnjoyLeole opened this issue May 30, 2017 · 3 comments

Comments

@EnjoyLeole
Copy link

Environment

  • Pythonnet version: 2.3.0
  • Python version: 3.5.2
  • Operating System: win10 64bit
    vs2017 community (15.2)
    .net framework 4.5.2

Details

try to call python script from c#, following your introduction, in both x86 & x64 platform

using(Py.GIL()){}

Then got following error:

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

@den-run-ai
Copy link
Contributor

den-run-ai commented May 30, 2017 via email

@den-run-ai
Copy link
Contributor

@EnjoyLeole you likely used nuget to install pythonnet and we found last week that VS does not switch architecture for Nuget installed package. You have to do it manually:

#472

@den-run-ai
Copy link
Contributor

Feel free to report back if this is not nuget.

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