Author Topic: DllNotFoundException: Unable to load DLL 'bass' or one of its dependencies  (Read 781 times)

ElTurkoCharro

  • Posts: 4
Hi everyone! I'm just starting with Bass and just getting into my new project.

I just have a couple of lines:

Imports Un4seen.Bass
Public Class Form1
    Dim Stream As Integer

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Un4seen.Bass.BassNet.Registration("myeMail", "myRegistrationNumber")

        Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)

    End Sub
End Class

When try to run the project, it shows the error: DllNotFoundException: Unable to load DLL 'bass' or one of its dependencies.

I've added the Bass.Net.dll as a reference as well as copied the Bass.Dll into the Debug folder project.

What else should I need to check?

Thanks!!



radio42

  • Posts: 4839
Make sure, the Bass.Net.dll as well as the bass.dll are located in the same directory as your executable- this doesn’t seem to be the case.
Also make sure the bass.dll is the correct version, eg. the 64Bit.

ElTurkoCharro

  • Posts: 4
Thanks for your suggestions, but after reviewing and redoing the copy of the files again, I'm ending up with the same result.

I've downloaded the Bass24 and Bass24.Net files from the un4Seen web page. After that, I copied the Bass.dll file from the Bass24\x64 folder and the Bass.Net.dll from the Bass24.Net\core folder into my bin\Debug project folder.

 :'(

radio42

  • Posts: 4839
Is your target a .Net core project or are you targeting the .Net v4.8?
If the later, copy the Bass.Net.dll from the FullFramework folder.

Else however, please start the Debugger and show at which line it fails - or check the provided samples, as it is all working here - so I can only assume, that the folder is somehow incorrect.

ElTurkoCharro

  • Posts: 4
Ok, I think I know what's going on. I did make a sample work (after many changes on security for some resx files)

When I first tried to run and example I'm getting the below error message:

Operación Compilar iniciada..
1>------ Operación Compilar iniciada: Proyecto: WaveForm Example, configuración: Debug Any CPU ------
1>D:\Visual Studio\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3327,5): error MSB3821: No se puede procesar el archivo wfExample.resx porque está en Internet o en una zona restringida, o bien tiene la marca de la Web. Quite esta marca si desea procesar los archivos.
========== Compilación: 0 correcto, 1 erróneo, 0 actualizado, 0 omitido ==========
========= Compilar se inició en 16:10 y tomó 00,161 segundos ==========

What the error said is:
The file wfExample.resx can't be processed due to it is in the Internet or in a unnaccesible zone, or it has a Web mark. Take out the mark to proceed.

This is happening with most of the resx files in the sample folders

I'm opening the folder on where the file is located, right click, properties and click over the Unlock option under security.

After remove the block for all the resx file the sample now can be executed after copying the bass.dll into the Debug folder.

What I'm also realized is that the examples files are configured as .Net 4.8 and my project is .Net 6.0. The examples now works, but my project keeps showing the same error message I said at the beggining. Even when I'm copying the Bass.Net.Dll from the .\core folder as the doc is explaining.

On top of that, I found also that for some reason, my Visual Studio is not allowing me to change the .Net version. Even having installed the .Net 4.8, I'm not able to change when the project was created as .Net 6.0 , and Visual Studio is not allowing me to create a new project with a different .Net version thatn 6.0. So at this point I'm thinking on a fresh installation and check from that.

Thanks for your support!

ElTurkoCharro

  • Posts: 4
I'm an Bruto Ignorante!!  :-[

I just realized that (as you said) I was trying to create a .Core project instead a .Net Framework. Now the .Net 4.8 options is there!!

Alleluya!!  ;D