We have a legacy 32-bit C++ dll that we want to use in the .NET MAUI app. The Android version (.so) of this library is working fine. But while trying to load the dll on Windows it fails with following error.
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B)
64-bit app and 32-bit dll can be solved using WCF or Remoting, but these solutions are not workable for our scenario.
We need to build the .NET MAUI app as 32-bit x86 app, but we haven't found any documentation regarding same.
Tried adding the following by manually editing the csproj file -
<PropertyGroup Condition="$(TargetFramework.Contains('-windows'))">
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>
But it broke the build with an seemingly unrelated error
error NETSDK1135: SupportedOSPlatformVersion 10.0.19041.0 cannot be higher than TargetPlatformVersion 10.0.17763.0.
Any directions or samples available anywhere?