Author Topic: BASS TypeInitializationException  (Read 6326 times)

irocks0922

  • Posts: 4
BASS TypeInitializationException
« on: 23 May '12 - 08:22 »
hello

I'm tying to make internet radio player.


but i started with exception :'(
[The type initializer for 'Un4seen.Bass.Bass' threw an exception.]

i put Bass.net.dll file on my [bin/debug] folder
and added to references

but still doesn't work

every time when i try call some methods related with bass
it happens

my environment

OS: WIN8 32bit
IDE: Visual Studio 11
language: C# and XAML

.net version
project : 4.5 (automatically set up)
bass: 2.0(i cant add 4.0 to references)



here is detailed message.


TypeInitializationException was unhandled by user code
  HResult=-2146233036
  Message=The type initializer for 'Un4seen.Bass.Bass' threw an exception.
  Source=Bass.Net
  TypeName=Un4seen.Bass.Bass
  StackTrace:
       at Un4seen.Bass.Bass.BASS_StreamCreateURL(String url, Int32 offset, BASSFlag flags, DOWNLOADPROC proc, IntPtr user)
       at dr1.BlankPage.Button_play(Object sender, RoutedEventArgs e) in c:\Users\kjjjh12\Documents\Visual Studio 11\Projects\dr1\dr1\BlankPage.xaml.cs:line 108
  InnerException: System.IO.FileNotFoundException
       HResult=-2147024894
       Message=The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
       Source=Bass.Net
       StackTrace:
            at Un4seen.Bass.Bass.a()
            at Un4seen.Bass.Bass.b()
            at Un4seen.Bass.Bass..cctor()
       InnerException:
[/table]


thanks for read this topic.
« Last Edit: 28 May '12 - 15:59 by irocks0922 »

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: BASS TypeInitializationException
« Reply #1 on: 23 May '12 - 15:03 »
That looks like you may be missing the BASS.DLL file, which should be placed alongside the BASS.NET.DLL file. If you don't currently have it, you can get it from the main BASS package, available from the BASS webpage.

irocks0922

  • Posts: 4
Re: BASS TypeInitializationException
« Reply #2 on: 24 May '12 - 00:53 »
That looks like you may be missing the BASS.DLL file, which should be placed alongside the BASS.NET.DLL file. If you don't currently have it, you can get it from the main BASS package, available from the BASS webpage.


i did that but still same thing happens

gnag

  • Posts: 160
Re: BASS TypeInitializationException
« Reply #3 on: 24 May '12 - 12:33 »
Are you sure you placed the bass.dll (downloaded from the un4seen.com website) in your Release/Debug Folder and you are starting the Executable in this folder too?

If you checked this two things and it still doesn't work you can upload your project for example on rapidshare.com and give us the link to check what else could be the problem !

irocks0922

  • Posts: 4
Re: BASS TypeInitializationException
« Reply #4 on: 26 May '12 - 13:47 »
Are you sure you placed the bass.dll (downloaded from the un4seen.com website) in your Release/Debug Folder and you are starting the Executable in this folder too?

If you checked this two things and it still doesn't work you can upload your project for example on rapidshare.com and give us the link to check what else could be the problem !

yes i placed bass.dll and bass.net.dll in Release/Debug folder

and i tried debug mode.

because its metro style app so i can't use exe file.

here is the link for my project
https://rapidshare.com/files/2762715998/dr1.zip

thanks for help. :)



gnag

  • Posts: 160
Re: BASS TypeInitializationException
« Reply #5 on: 27 May '12 - 00:27 »
Seems like a compatibility Issue to me, the .NET 4 DLL can't be added since it uses "too much" Components which Metro doesn't provide according to this Article: http://www.codeproject.com/Articles/363673/From-Win32-to-WinRT

A reference to .NET 2 DLL can be added but fails with TypeInitializationException.

I think in this case the Bass devs need to make some changes, even a simple Bass.ErrorGetCode() produced the Exception so it is not a Problem in your code causing the Exception.

Are there any Plans on making Bass .NET Windows 8 / Metro compatible, Ian ?

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: BASS TypeInitializationException
« Reply #6 on: 28 May '12 - 15:40 »
The Metro stuff only has a subset of the normal Windows APIs available (link below), which doesn't include quite a bit of what BASS is using, most notably DirectSound. So it won't be possible to use the existing BASS.DLL in a Metro style app. It would need a separate BASS version. There are no immediate plans for that, but something may well appear in future if the demand is there.

   http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx

irocks0922

  • Posts: 4
Re: BASS TypeInitializationException
« Reply #7 on: 28 May '12 - 15:58 »
Anyway.. thanks for help ;D

so i can stop wasting my time.



should have look into these things..
 :'(

jeffer

  • Guest
Re: BASS TypeInitializationException
« Reply #8 on: 24 Jun '12 - 19:51 »
I am having the same problem. I see two others are. Has anyone responded to this problem?

gnag

  • Posts: 160
Re: BASS TypeInitializationException
« Reply #9 on: 24 Jun '12 - 20:40 »
@jeffer: The Message BASS TypeInitializationException usually is caused by not/wrong placed Bass DLLs or wrong (32/64) bit Version of the Software you are creating or the Bass DLLs.

But in this case the OP was trying to create a Windows 8 Metro App which uses Bass which is currently possible, just read the Answer from "Ian @ un4seen" here.

Eytan

  • Posts: 22
Re: BASS TypeInitializationException
« Reply #10 on: 31 Aug '13 - 21:17 »
I also have the same problem.
what iI have to do?

Eytan

  • Posts: 22
Re: BASS TypeInitializationException
« Reply #11 on: 31 Aug '13 - 21:32 »
When I put bass.dll & bass.net.dll in my Debug Folder the problem solved.
 :)