-2

One year ago I was using bass.dll on a mp3 project. Back then I was using Windows 7, 32bit. Now I am on another project and I need to use the bass.dll again. This time I am on Windows 8.1, 64bit.

Bass_Start() is giving me this exception as well as all the other functions

An unhandled exception of type 'System.BadImageFormatException' occurred in EZBlocker.exe

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

I am using DllImport to import those functions and the bass.dll in in my project.

[DllImport("bass.dll")]
public static extern bool BASS_Start();

try
            {
                BASS_Start();
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

What am I missing here besides these thousands of bugs these 64bits windows are giving me? It is my first time on 64bit and I really regretting it...

user2530266
  • 287
  • 3
  • 18
  • What kind of application is it? You can set the build to x86 in the project settings and compile.If it is web application hosted on IIS, you can set "Enable 32 Bit applications" to true on the site settings in IIS.See here http://code217.blogspot.com/2013/08/aspnet-systembadimageformatexception.html – nobody Mar 19 '16 at 22:55
  • 1
    Looking at their website, they do support 64bit. But they say to ensure you are using the correct library. So maybe its worth checking you have the latest of the .dll, to use with the correct .NET framework. – Mayura Vivekananda Mar 19 '16 at 22:58

1 Answers1

0

If you are building your project on x86 only then you will need to use the same version of bass dll. You could always use the Bass.Net dll. You can include it in your project and call all the functions from the bass.dll from there.

John P.
  • 1,199
  • 2
  • 10
  • 33