Click here to Skip to main content
15,894,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I've trying to get image via web cam. I have added related .dll into reference. Project can build without any bugs. When it run this exception is thrown.

"{"Could not load file or assembly 'AForge.Video, Version=2.2.3.0, Culture=neutral, PublicKeyToken=cbfb6e07d173c401' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"AForge.Video, Version=2.2.3.0, Culture=neutral, PublicKeyToken=cbfb6e07d173c401"}"


It will happen when execute this method

SetCamera(0);

cannot move into setCamara method. camara is already plugin to the PC

// content of SetCamara
C#
public void SetCamera(int index)        
        {
            if (Devices.Count < 1)
            {
                //throw new IndexOutOfRangeException("There is no device with index " + index);
                throw new IndexOutOfRangeException("There is no device with index " );
            }

            //SelectedDevice = new VideoCaptureDevice(Devices[index].MonikerString);
            SelectedDevice = new VideoCaptureDevice(Devices[0].MonikerString);
        }


If anyone have idea to resolve this problem, pls let me know.

Thanks,
Chamara
Posted
Comments
Sergey Alexandrovich Kryukov 9-Nov-12 2:08am    
Are you show you correctly copied the assembly full name with the token? It looks like expected assembly (as prescribed in the reference to it) and assembly name found from file to be loaded are identical. If it was the case, the assembly would load successfully. Please check up again.
--SA

Thanks,

I found the error. Aforge.video.dll of version 2.2.4.0

But project needed version 2.2.3.0 .so I have replase correct dll.then it run without bugs.
 
Share this answer
 
Please see my comment to the question and check up things. But I would prefer a nice workaround. AForge.NET is open source. Add it in the form of the source project to your solution, reference it as project ("Projects" tab of the "Add Reference" window) and build the whole solution. The correspondence between referenced and actual assembly will be supported automatically in each build. This is the real beаuty of having source code…

Here:
http://en.wikipedia.org/wiki/AForge.NET[^],
http://www.aforgenet.com/[^],
http://www.aforgenet.com/framework/downloads.html[^].

Source code is here: http://aforge.googlecode.com/files/AForge.NET%20Framework-2.2.4.zip[^].

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900