I'm getting this error at runtime in a C# windows forms application after I replaced the EmguCV 4.7.0 library files with 4.6.0. I downgraded because 4.7.0 does not have support for CUDA yet.

I did not enable CUDA or download the drivers yet, I just replaced the EMGUCV DLL files. It should work without CUDA by default, but it's crashing on Application.Run(new MainForm()) with error:

FileLoadException: Could not load file or assembly 'Emgu.CV, Version=4.6.0.5131, Culture=neutral, PublicKeyToken=7281126722ab4438' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I made sure the new DLLs (Emgu.Cv.dll and cvextern.dll) are copied to the x64/Debug folder, under library files I checked Copy if newer and made sure they are in the Debug folder when running

Also in the references I can see Version 4.6.0 of the EmguCV Dll

What else am I forgetting to change to make it work? Am I missing some other DLLs that are needed for CUDA version that aren't needed for non Cuda version? I made sure I'm using the cvextern.dll from the 4.6.0 Cuda version

I made sure to try cleaning and rebuilding, it didn't work

I'm also Not using the NuGet package manager, just loading the dlls manually.

1

There are 1 best solutions below

0
Mich On

Apparently I still need to manually change app.config file to

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="Emgu.CV" publicKeyToken="7281126722ab4438" culture="neutral" />
            <codeBase version="4.6.0.5131" href="path-to-new-Emgu.CV-assembly.dll" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

Thank you chatgpt