Author Topic: UNO Platform .NET5  (Read 1271 times)

BaseHead

  • Posts: 198
UNO Platform .NET5
« on: 13 Jun '21 - 07:21 »
Hey guys!
We are thinking of moving our flagship over brick by brick to the UNO Platform to avoid writing a separate macOS version from now on.
Anyone get BASS going in this?
I got a test app working in the UWP project but the macOS version is throw up errors when I try and Init BASS with this error

System.TypeInitializationException: The type initializer for 'Un4seen.Bass.Bass' threw an exception. ---> System.TypeLoadException: Could not resolve type with token 01000064 from typeref (expected class 'System.Reflection.MethodBase' in assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
   --- End of inner exception stack trace ---
  at UNO3.MainPage.Play () [0x00013] in /Users/steve/Google Drive/UNO3/UNO3/UNO3/UNO3.Shared/MainPage.xaml.cs:69


I can't get BASS error codes cuz I think it's a full on fail right now starting it.

I'm using the BASS.NET Core .dll in the BASS.NET package and no build or errors in VS.
but more importantly anyone have any info using BASS via the UNO Platform that might be helpful and save us some time like "Don't Do it!"   haha. ;-)

thx for any info of other that went down this same path.  8)
Steve

BaseHead

  • Posts: 198
Re: UNO Platform .NET5
« Reply #1 on: 14 Jun '21 - 11:01 »
and I should point out that the same BASS.NET core .dll works fine on PC with the UNO UWP target  8)

Ian @ un4seen

  • Administrator
  • Posts: 26093
Re: UNO Platform .NET5
« Reply #2 on: 14 Jun '21 - 15:47 »
I'm unfamiliar with all of that, so unfortunately I can't offer any useful advice, but have you tried the Bass.Net.OSX.dll file (from the BASS.Net package) on macOS? If not, could be worth a try.

BaseHead

  • Posts: 198
Re: UNO Platform .NET5
« Reply #3 on: 15 Jun '21 - 09:40 »
OOHhh.....I didn't even see that.  I figured .NET Core all used the same dll's
I will try later today!  Thx man!

BaseHead

  • Posts: 198
Re: UNO Platform and .NET5 and BASS.NET
« Reply #4 on: 17 Jun '21 - 16:08 »
So your suggestion got us over that hurdle thx man!

Basically we are doing a C# shootout between AvaloniaUI, UNO Platform and .NET MAUI
All three of these newish frameworks promise write once use everywhere.

AvaloniaUI is working fine on PC and macOS with BASS.NET now thx to you. 8)
but UNO is showing this error as if the bass.dll is not next to the EXE on macOS

System.TypeInitializationException: The type initializer for 'Un4seen.Bass.Bass' threw an exception. ---> System.DllNotFoundException: bass assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Un4seen.Bass.Bass.BASS_SetConfig(Un4seen.Bass.BASSConfig,int)

we have bass.dll, bassmix.dll, libbass.dylib, llibbassmix.dylib and Bass.Net.OSX.dll all in the debug folder.

Any tricks to figure this one out?
Thx man!
Steve



« Last Edit: 18 Jun '21 - 08:30 by BaseHead »

BaseHead

  • Posts: 198
Re: UNO Platform .NET5
« Reply #5 on: 20 Jun '21 - 16:12 »
Oh I should point out we are definitely set to build at x64 with 64bit bass.dll's as I know many times in the past people would make that mistake but we quadruple checked we are all x64. ;-)

Any ideas what to try anyone or how to solve this?
s.

Ian @ un4seen

  • Administrator
  • Posts: 26093
Re: UNO Platform .NET5
« Reply #6 on: 21 Jun '21 - 15:56 »
I'm not a .Net user myself, so unfortunately I don't have any tips and tricks for that. I can only guess that the EXE's directory isn't in the library search path, so the BASS library isn't found. Are you successfully using any other libraries that are also alongside the EXE?

radio42

  • Posts: 4839
Re: UNO Platform .NET5
« Reply #7 on: 21 Jun '21 - 16:48 »
seems I got the same request by mail... but same here. I am also not familiar with those.
But you indicated, that it is working fine for 'AvaloniaUI' but not on the other two - so I can only guess, that the other two might have issue with the static linking?

BaseHead

  • Posts: 198
Re: UNO Platform .NET5
« Reply #8 on: 22 Jun '21 - 10:55 »
Ian, it's all definitely all in the correct place.  I think Bernd is on to something...
Avalonia is setup exactly the same so my guess it's it's doing some detection behind the scenes for us and auto-static linking cuz we did you anything special yet....hehe

You guys have an example how to static link it?
Been Googling all day and haven't stumbled on an example just yet.

thx so much!

Steve

Ian @ un4seen

  • Administrator
  • Posts: 26093
Re: UNO Platform .NET5
« Reply #9 on: 22 Jun '21 - 14:10 »
Are you sure static linking is involved here? Apple does require the use of static libraries on iOS, but not on macOS. So the BASS libraries are only static on iOS (dynamic on all other platforms).

My guess is that the working platform is adding the EXE's directory to the library search path while the non-working one isn't. Windows includes the EXE's directory automatically but other platforms don't, so that would also explain why it's working on Windows and not on macOS.

Do the platforms have any documentation on using native libraries?

BaseHead

  • Posts: 198
Re: UNO Platform .NET5
« Reply #10 on: 13 Jul '21 - 07:43 »
Some followup on this in case anyone other BASS user wants to go down the Cross-platform desktop path with UNO Platform or MAUI path and need to build for macOS....
DON'T waste your time with either of those two!  haha 
As of this writing this neither are even close to ready for primetime and we were never ever able to make BASS/BASS.NET work on macOS for either.

So in the end we decided to use AvaloniaUI as we have used it before and know it works solid plus libBass.dylib works perfect on that without the need for jumping thru extra hoops.
Avalonia doesn't have all the flashy bells and whistles but performance is far better than the other two that feel like they are running thru an emulator and it's true pixel perfect on both platforms.

Hopefully this info in the future can save another BASS user from wasting time like we did.  ;-)


Osteerha

  • Posts: 1
Re: UNO Platform .NET5
« Reply #11 on: 20 Aug '24 - 20:31 »
I've run into similar problems before, and it can be really annoying when things don't work the same across different platforms. But it's good to hear that AvaloniaUI is working out for you—sometimes it's just easier to stick with what you know works.
Well, when I'm not dealing with these tech issues, I like to take a break with a game of solitaire. So, if you're ever in need of a quick break, this game might be worth a try.
« Last Edit: 26 Aug '24 - 21:35 by Osteerha »