I'm developing a .NET app using Visual Studio Community 2015, which uses some of the AForge.NET libraries. I added the references to my project, and when I debug the app the libraries work fine. However, when I publish the app and install it in the same computer, as soon as I reach a part of the application in which the AForge.NET libraries are used, the app crashes with the following error:
System.IO.FileNotFoundException: Could not load file or assembly 'AForge.Video.FFMPEG.dll' or one of its dependencies. The specified module could not be found.
Filename: 'AForge.Video.FFMPEG.dll'
on MyApp.mySecondForm..ctor(Int32 id)
on MyApp.myMainForm.myListView_DoubleClick(Object sender, EventArgs e)
on System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
on System.Windows.Forms.ListView.WndProc(Message& m)
on System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
on System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
on System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I've searched online for solutions to this, and so far none of the following has worked for me:
- Installing Visual Studio C++ Redistributable (thinking it might have been a missing dependency)
- Using the File System Editor to add the library on installation (I can't find the editor in Visual Studio).
Also, I searched for the folder where the app was installed, and I see all the DLL files are there, each in a different folder, along with a single folder with every DLL among other files.
I have no issues with other libraries (the ones in the Global Assembly Cache), such as MySql.Data
.
Following a suggestion by Chris O, I used the Process Monitor to check on my app, and it shows it's looking for the AForge libraries in the GAC; since I haven't added them there, there's no way they can be found.
What do I need to do in order to configure my app so it can access the libraries from an app folder instead of looking for them in the GAC?