21 May '13 - 19:08 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Exception  (Read 1831 times)
jonarmstrong
Guest
« on: 9 Dec '11 - 01:41 »
Reply with quoteQuote

I'm adding netcode to a program that uses your library. I didn't develop the application, I'm just adding the netcode to it. I have the complete source and I was sent all the libraries with it. Everything loads into visual studio well enough, however when I compile it and run it within Visual Studio I get the following exception:

The type initializer for 'Un4seen.Bass.Bass' threw an exception.

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

Make sure the file image is a valid managed assembly.
Make sure you have supplied the correct file path for the assembly.

So, what did I screw up?
Logged
jonarmstrong
Guest
« Reply #1 on: 9 Dec '11 - 01:46 »
Reply with quoteQuote

I should also add that when I try to re-add the references to the libraries, I get the following error:
A reference to 'C:\Users\**\**\**\**\bass.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
Logged
radio42
Posts: 4012


« Reply #2 on: 9 Dec '11 - 08:25 »
Reply with quoteQuote

I guess you are working with .Net on a x64 OS.
If you are running a x64 OS you should take care of your compiler settings.
If you compile your project with the for 'Any CPU' settings - you would need the 64-bit versions of the native bass.dll !
Or set your build to target the 'x86' platform!
See the docs for detailed info - or here:
http://www.bass.radio42.com/help/html/b8b8a713-7af4-465e-a612-1acd769d4639.htm#32vs64

In addition you should add the 'Bass.Net.dll' in your project references and not bass.dll - as bass.dll is an unmanaged lib.
Logged
jonarmstrong
Guest
« Reply #3 on: 9 Dec '11 - 08:32 »
Reply with quoteQuote

I guess you are working with .Net on a x64 OS.
If you are running a x64 OS you should take care of your compiler settings.
If you compile your project with the for 'Any CPU' settings - you would need the 64-bit versions of the native bass.dll !
Or set your build to target the 'x86' platform!
See the docs for detailed info - or here:
http://www.bass.radio42.com/help/html/b8b8a713-7af4-465e-a612-1acd769d4639.htm#32vs64

In addition you should add the 'Bass.Net.dll' in your project references and not bass.dll - as bass.dll is an unmanaged lib.

You guessed correctly that I'm working with .NET on a x64 OS.

However, not only is the .NET version referenced but the project is set to build for x86 and the exception is thrown.
Logged
jonarmstrong
Guest
« Reply #4 on: 9 Dec '11 - 08:40 »
Reply with quoteQuote

I guess you are working with .Net on a x64 OS.
If you are running a x64 OS you should take care of your compiler settings.
If you compile your project with the for 'Any CPU' settings - you would need the 64-bit versions of the native bass.dll !
Or set your build to target the 'x86' platform!
See the docs for detailed info - or here:
http://www.bass.radio42.com/help/html/b8b8a713-7af4-465e-a612-1acd769d4639.htm#32vs64

In addition you should add the 'Bass.Net.dll' in your project references and not bass.dll - as bass.dll is an unmanaged lib.

You guessed correctly that I'm working with .NET on a x64 OS.

However, not only is the .NET version referenced but the project is set to build for x86 and the exception is thrown.

Found the problem. The target platform changes wouldn't stick but I forced it and now it's working.
Logged
Cody
Guest
« Reply #5 on: 10 Dec '11 - 05:30 »
Reply with quoteQuote

I guess you are working with .Net on a x64 OS.
If you are running a x64 OS you should take care of your compiler settings.
If you compile your project with the for 'Any CPU' settings - you would need the 64-bit versions of the native bass.dll !
Or set your build to target the 'x86' platform!
See the docs for detailed info - or here:
http://www.bass.radio42.com/help/html/b8b8a713-7af4-465e-a612-1acd769d4639.htm#32vs64

In addition you should add the 'Bass.Net.dll' in your project references and not bass.dll - as bass.dll is an unmanaged lib.

You guessed correctly that I'm working with .NET on a x64 OS.

However, not only is the .NET version referenced but the project is set to build for x86 and the exception is thrown.

Found the problem. The target platform changes wouldn't stick but I forced it and now it's working.
Hey, I'm having the exact same issue. How exactly did you work your's out?
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines