简体   繁体   中英

Debug WebService in Visual Studio: Could not load file or assembly

I'm writing a WebService that references another managed DLL which then uses a third-party DLL. When I start debugging my WebService I get the following error:

Could not load file or assembly 'AForge.Video.FFMPEG.DLL' or one of its dependencies.

As recommended in many other posts, I tried these steps:

  • Changed from AnyCPU to x86
  • Copied all DLLs to %system32% directory

But had no success so far. Any ideas?

Thanks, Matthias

Could not load file or assembly 'AForge.Video.FFMPEG.DLL' or one of its dependencies.

You are either copying the file(s) to the wrong place or not copying the correct files.

Get to the bottom of this by downloading Dependency Walker

You can then drag AForge.Video.FFMPEG.DLL into the application and it will tell you what is missing.

Also, determine the base directory for your application to ensure you are copying the files to the correct folder at runtime. You can do this by writing System.AppDomain.CurrentDomain.BaseDirectory to the console (or add it to your watch)

Also see this

I re-engineered the project structure in VisualStudio to get rid of the dependency to AForder.Video.FFMPEG.DLL. That helped. I found no other solution so far.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM