C ++ / CLI / C # BadImageFormat exception on form loading

I created a C ++ / CLI assembly that creates a wrapper around my own C ++ code. Resource compilation and assembly are loaded into my C # project when I add it as a resource. I can access my objects and intellisense from my application, but when I try to create it, the failure is eliminated:

BadImageFormat

Failed to load file or assembly 'MyCLI, Version = 1.0.3680.28432, Culture = neutral, PublicKeyToken = null' or one of its dependencies. An attempt was made to download a program using the wrong format.

I load it into the form load event:

MyCLI.myCLI z;

... and when I compile it crashes in this line of my main constructor in C #

Application.Run(new Form1());

Does anyone have any idea what this exception might raise?

thank

+3
1

64- . # 64- . , 32- ++/CLI.

# Project + Properties, Application, Platform Target = x86. 64- ++/CLI, Build + Configuration Manager. Platform Target - .

+7

Source: https://habr.com/ru/post/1730490/


All Articles