Home:ALL Converter>Dotnet core run as 32bit 86x on Linux

Dotnet core run as 32bit 86x on Linux

Ask Time:2020-10-03T12:27:06         Author:Baganaakh

Json Formatter

I'm trying to control RFID reader on linux using Dotnet core 3

ReaderDynamicLib.dll is main controller file which is not my created dll file. It is manufacture provided sdk file runs on only 32bit I tried it in windows.

I created console application to send parameter to ReaderDynamicLib.dll

public static extern int SetAntenna(int hScanner, int m_antenna_sel, int Address);

like this runs fine on windows but in linux

  An attempt was made to load program with an incorrect format

I assume linux don't have run as 32bit option

Author:Baganaakh,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/64180714/dotnet-core-run-as-32bit-86x-on-linux
pvenky :

It's probably irrelevant now, but for future reference, the problem here is that the vendor dll was likely compiled to work on Windows platform (since you are able to run it on Windows). You cannot then DllImport the exact same library into a .NET program running on linux. A binary that is native-compiled to work on the Windows platform will not load on the linux platform. It will have to be recompiled targeting linux.",