Native dll

Trying to import a native dll  in our custom code like 

[DllImport("native.dll", CallingConvention = CallingConvention.Cdecl)]

The code was working fine with the webserver but this code should be executed as a job when we converted this as a service we are seeing the below exception

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)



spell check
[edited by: Satish Kumar Polampalli at 9:11 AM (GMT 0) on Thu, Oct 28 2021]