System.IO.FileNotFoundException: Could not load file or assembly 'LameDLLWrap, Version=1.0.0.0
dll, naudio
Solution
`LameDLLWrap` is an internal pair of assemblies stored as resources in the `naudio.lame.dll` assembly. Depending on which bit depth you are running in, either the 32-bit or 64-bit version will be unpacked and loaded, and will then load the appropriate `libmp3lame` dll. As a result you must have both `libmp3lame.32.dll` and `libmp3lame.64.dll` files deployed with your application alongside the `naudio.lame.dll` assembly, or it will fail.
The NuGet package should configure the project to include both of the files, and should set the properties on the files to ensure that they are copied to the output.
In your project explorer ensure that you have the two native DLLs `libmp3lame.32.dll` and `libmp3lame.64.dll` included. Click on each one and check the properties to ensure that the `Copy To Output Directory` property is set to `Copy always` for both of these files.
If not, either set them yourself or use NuGet to remove and re-add the `NAudio.Lame` package.
If this doesn't solve the problem, let me know and I'll see if I can find out what is going wrong.
I tested the NuGet package with Visual Studio 2012 and 2013, the latest NuGet Package Manager (v2.7.41101.371), and with all three compilation targets (`x86`, `x64` and `Any CPU`). In all combinations it functioned as expected. If you are using a different configuration let me know as part of your response.
**Update
After a bit of playing around, it seems that there was a problem with the Loader not being properly initialized in some configurations when run outside the IDE. This was due to one of the static initializers not being called.
Problem is fixed and v1.0.2 is now up on NuGet. Please update the package and try again.
Problem
I am working on a project which capture speaker audio and write it to a MP3 File using naudio and naudio.lame . I add both DLL to my project from nugget enter link description here and its working fine but problem is when I go to bin >release or debug folder and then click on exe then it show error. I copy all DLL to that folder and also try to create new project and then add ref but nothing works still showing same error when click on exe. Any Help Thanks Here is error msg:- ``` ee the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.IO.FileNotFoundException: Could not load file or assembly 'LameDLLWrap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'LameDLLWrap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at NAudio.Lame.LameMP3FileWriter..ctor(Stream outStream, WaveFormat format, Int32 bitRate) at NAudio.Lame.LameMP3FileWriter..ctor(String outFileName, WaveFormat format, Int32 bitRate) at WindowsFormsApplication1.Form1.wavtomp3() in c:\Users\aman\Documents\Visual Studio 2010\Projects\WindowsFormsApplication4\WindowsFormsApplication4\Form1.cs:line 37 at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in c:\Users\aman\Documents\Visual Studio 2010\Projects\WindowsFormsApplication4\WindowsFormsApplication4\Form1.cs:line 24 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. ************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18052 built by: FX45RTMGDR CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll ---------------------------------------- WindowsFormsApplication4 Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Users/aman/Documents/Visual%20Studio%202010/Projects/WindowsFormsApplication4/WindowsFormsApplication4/bin/Release/WindowsFormsApplication4.exe ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18047 built by: FX45RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18021 built by: FX45RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18044 built by: FX45RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- NAudio Assembly Version: 1.7.0.15 Win32 Version: 1.7.0.15 CodeBase: file:///C:/Users/aman/Documents/Visual%20Studio%202010/Projects/WindowsFormsApplication4/WindowsFormsApplication4/bin/Release/NAudio.DLL ---------------------------------------- NAudio.Lame Assembly Version: 1.0.1.1318 Win32 Version: 1.0.1.1318 CodeBase: file:///C:/Users/aman/Documents/Visual%20Studio%202010/Projects/WindowsFormsApplication4/WindowsFormsApplication4/bin/Release/NAudio.Lame.DLL ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. ```