Click here to Skip to main content
11,573,935 members (69,032 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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=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
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 8-Nov-12 18:26pm
Comments
Sergey Alexandrovich Kryukov at 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
Rate this: bad
good
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…

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
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS


Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2015
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