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]
Parents Reply Children
  • Former Member
    0 Former Member in reply to Satish Kumar (3sides)

    Here's a previous thread discussing ways to do this:  (Missing Forum Reply)  

    To work around this, you need to either run the Job Server on a 32-bit OS, or use the CorFlags utility in the .Net SDK to remove the 32 bit preference. (coreflags.exe Telligent.Jobs.Server.exe /32BITPREF-). See https://msdn.microsoft.com/en-us/library/ms164699%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396  for more details.