We are trying to change a program from 32-bit to Any CPU. The program is in C# on .NET 3.5.
We are using Windows Task Scheduler COM wrapper.
The application compiles but when we try to run it on a 64-bit platform we are getting the following error:
BadImageFormatException: Could not load file or assembly 'Interop.TaskScheduler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4b71cab8d8e4499f' or one of its dependencies. An attempt was made to load a program with an incorrect format.
UPDATE: We created a new C# project in Any CPU, with TaskScheduler as a Reference, and with a very simple 2-line code (create an instance of TaskSchedulerClass and write a line to the console). We ran it on the same 64-bit platform, and it worked. However, the entire application is still not working. Thank you for your help.
Since its a COM interop assembly, likely its only 32-bit. You have to keep your project as 32-bit.