Could not load or assembly or one of its dependencies

Prathibha Chiranthana picture Prathibha Chiranthana · Aug 27, 2014 · Viewed 15k times · Source

I am using Aforge.net frame work for doing image processing work. I have add 'AForge.Video.FFMPEG.dll' as a referance to my project. I am using VS2012 and 32 bit build target. When Buiding i get

 System.IO.FileNotFoundException was unhandled
  HResult=-2147024770
  Message=Could not load file or assembly 'AForge.Video.FFMPEG.dll' or one of its dependencies. The specified module could not be found.
  Source=VideoReadere
  FileName=AForge.Video.FFMPEG.dll
  FusionLog=""
  StackTrace:
       at VideoReadere.Form1..ctor()
       at VideoReadere.Program.Main() in c:\Users\Prabad\Documents\Visual Studio 2012\Projects\VideoReadere\VideoReadere\Program.cs:line 19
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

my code for that is occur exception

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace VideoReadere
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
//here below line give exception
            Application.Run(new Form1());
        }
    }
}

Answer

skm picture skm · Sep 10, 2014

You need to copy DLLs from "Externals\ffmpeg\bin" to your AForge.Video.FFMPEG.dll location and maybe you need to install Microsoft Visual C++ Redistributable.