# FMOD C# initialization error with imported function FMOD5\_System\_Create()

**URL:** <https://qa.fmod.com/t/fmod-c-initialization-error-with-imported-function-fmod5-system-create/15553>\
**Category:** FMOD Engine\
**Created:** [March 17, 2020, 8:46pm UTC](https://qa.fmod.com/t/fmod-c-initialization-error-with-imported-function-fmod5-system-create/15553 "2020-03-17T20:46:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshsickheadgames](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@joshsickheadgames](https://qa.fmod.com/u/joshsickheadgames)\
**Post date:** [March 17, 2020, 8:46pm UTC](https://qa.fmod.com/t/fmod-c-initialization-error-with-imported-function-fmod5-system-create/15553/1 "2020-03-17T20:46:44Z")

</div>

I am getting a returned exception while trying to use the function FMOD5\_System\_Create().

The exception is a System.BadImageFormatException.

Here is the code I am using to initialize fmod:

public struct Factory  
{  
public static RESULT System\_Create(out System system)  
{  
return FMOD5\_System\_Create(out system.handle);  
}

```
    #region importfunctions
    [DllImport(VERSION.dll)]
    private static extern RESULT FMOD5_System_Create(out IntPtr system);

    #endregion
}

```

If anyone can help me understand what is happening, I would be much appreciated.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [March 23, 2020, 4:40am UTC](https://qa.fmod.com/t/fmod-c-initialization-error-with-imported-function-fmod5-system-create/15553/2 "2020-03-23T04:40:13Z")

</div>

It may be that the lib you are trying to use is for the wrong architecture or platform.
