Free Support Forum - aspose.com

Build Warning

I added the OCR nuget package to a .Net Framework 4.7.2 but during build, it printed this error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference “Aspose.OCR, Version=19.9.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=AMD64”, “AMD64”.

Also, when debugging it, there is a runtime error:

An unhandled exception of type ‘System.BadImageFormatException’ occurred in TestOCR.exe
Could not load file or assembly ‘Aspose.OCR, Version=19.9.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Please advise. Thanks

@speridian

It is necessary that application should be built in x64 mode instead of AnyCPU. Currently we do not support AnyCPU or x86 architectures because we use specific CPU instruction sets that are not available in x86 mode.