AForge.Video.FFMPEG failed to load for ASP.NET application when it worked for Windows Form application

I get the following error:

ASP.NET runtime error: Could not load file or assembly "AForge.Video.FFMPEG.DLL" or one of its dependencies. The specified module was not found.

This worked for me in a Windows Forms project, but after trying to convert the project to ASP.NET, I could not start it. I used a 64-bit DLL, but now switched to using a 32-bit DLL, because I seem to have made more progress (getting a similar error with a 64-bit DLL).

I installed the target platform for x86 in the project properties, and also tried to install it on any CPU (which triggers warnings, since DLLs are native 32-bit), and also tried to change the target to x64 using 64-bit DLLs.

In the IIS application pool, I have set the value to "Enable 32-bit applications." Removing this DLL causes the project to work and adding it back in case of failure.

I tried:

  • Insert a DLL into System32.
  • Insert bin folder (with DLL) in PATH.
  • Setting the target goal of the application for all possible options (x86, x64, any processor).
  • It is checked that the DLL is not corrupted and even tried to compile another source.
  • All FFMPEG DLLs are located in the bin folder; also tried to put them in System32.

, DLL ( Windows Forms, , , ). , - .

, Google, DLL ASP.NET. , , .

+4
3

. - DLL FFmpeg (avformat-53.dll, avutil-51.dll ..) C:\Windows\System32 .

, DLL PATH. , DLL .

- , , , , - , PATH System32 .

+1

, , ( AForge DLL ): -

  • →
  • "" ().
  • X86

, , !

+1

. . . , .

  • The copied DLL files from "Externals \ ffmpeg \ bin" to output the output directory (where the executable remains);
  • Also copied these. DLL in the C: / Windows / System32 directory.
  • Install x86 built for the target (runs in 32-bit mode).
  • Although my project was based on platform 4.5, I also installed v3.5.
  • Finally, I added useLegacyV2RuntimeActivationPolicy="true"in app.config -
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <startup useLegacyV2RuntimeActivationPolicy="true"> //useLegacyV2RuntimeActivationPolicy for older .net version
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
   </startup>    
 </configuration>
+1
source

All Articles