Reputation: 4695
I am getting 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 could not be found.
I had this working in a Windows Forms project but after trying to convert the project to an ASP.NET one, I've been unable to get it to run. I was using a 64 bit DLL there, but have switched to using a 32 bit DLL now because I seem to be making more progress with that (got a similar error with the 64 bit DLL).
I've set the platform target to x86 in project properties and have also tried setting it to any CPU (which triggers warnings since the DLLs are native 32 bit) and have also tried changing the target to x64 while using the 64 bit DLLs.
In the IIS application pool, I have "Enable 32-Bit Applications" set to be true. Removing this one DLL causes the project to work and adding it back in causes it to fail.
I've tried:
There's no code even using the DLLs in this project (I have code in a Windows Forms project that I'm going to merge into this, but I can't do that if the references don't even work). I've even created new projects in case there's some weird artefact in the projects.
Note that I've read pretty much every Google result related to this DLL and ASP.NET. None of the approaches seem to work.
Upvotes: 5
Views: 6322
Reputation: 7291
I faced the same problem. Now it's working nice. I did couple of things. Though I am not sure which one was actually made my application working.
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>
Upvotes: 2
Reputation: 1297
I've found that this error was resolved when I did the following steps (with AForge DLL's in your project and referenced):-
See if this helps, it worked for me!
Upvotes: 1
Reputation: 4695
I've found a solution. For whatever reason, putting the FFmpeg DLLs (avformat-53.dll, avutil-51.dll, etc) in the C:\Windows\System32
folder works.
I don't understand why the DLLs can't simply be in the PATH. Also, it's quite inconvenient to be placing DLLs in this location.
Due to how unideal this is, I'm going to hold off accepting this as the answer, in hopes that someone else can give a better solution or at least explain why the PATH or System32 did not work.
Upvotes: 1