I have an X++ method (residing in the Fleet Management module) that I need to call within a C# class library.
I have used the below link as a guide -> https://ax.help.dynamics.com/en/wiki/writing-business-logic-in-c-and-x-source-code/
Basically, I have a c# console application, and I am making a call to this ax method as below
using Dynamics.AX.Application; using Microsoft.Dynamics.Ax.Xpp; class Program { static void Main(string[] args) { DFM_H5PortalSerializer axClass = new DFM_H5PortalSerializer(); axClass.processString("test"); }
}
The ax Class is shown in intellisense, however, as soon as I run it, i get the following exception:
"An unhandled exception of type 'System.BadImageFormatException' occurred in mscorlib.dll
Additional information: Could not load file or assembly 'Dynamics.AX.FleetManagement, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."
Any ideas on what is causing the issue and how to solve it?
Thanks
*This post is locked for comments