Click here to Skip to main content
12,884,509 members (32,036 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0
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=, 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=, Culture=neutral, PublicKeyToken=cbfb6e07d173c401"}"

It will happen when execute this method


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

// content of SetCamara
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.

Posted 8-Nov-12 18:26pm
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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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…


Source code is here:[^].

Rate this: bad
Please Sign up or sign in to vote.

Solution 2


I found the error. of version

But project needed version .so I have replase correct dll.then it run without bugs.

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170422.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100