locked
The type initializer for 'Emgu.CV.CvInvoke' threw an exception RRS feed

  • Question

  • screen shot

    here is the error im encountering.. i have tried to google the problem and  still no luck...

    a handy solution is well appreciated... thanks and sorry for the problem..

    • Moved by Jason Dot Wang Thursday, September 20, 2012 5:45 AM This thread is about OpenCV (From:Visual C# General)
    Tuesday, September 18, 2012 4:10 PM

Answers

  • If you look at the innerexception on the trace that will lead you to the root cause.  When programs start in CLR the loader attempts to locate the DLLS to run.  If it cannot find them you are out of luck.  There is a log the loader uses which can tell you where it looked to find the dll.  I think it's called the Fusion Log, easily found on internet.

    I am thinking the "Unable to load DLL" message may have something to do with that.  Keep in mind however, that no all DLLS are loadable as I have tried to load DLLs from 3rd party vendors before with no luck.  I think there are very specific rules on what DLLs the Fusion component can load.  There are two loaders, one for CLR and one for Native loads.  I don't know exactly how each one gets invoked but have seen both of them in WINDBG traces before.


    JP Cowboy Coders Unite!

    • Proposed as answer by Jason Dot Wang Thursday, September 20, 2012 5:30 AM
    • Marked as answer by Deo GM Cabral Tuesday, September 25, 2012 9:34 AM
    Tuesday, September 18, 2012 5:37 PM

All replies

  • Hi, the OpenCV_core242.dll is missing.

    Similar issues and suggestions to solve the problem:

    http://stackoverflow.com/questions/2694994/opencv-dll-missing-but-its-not

    http://stackoverflow.com/questions/8247273/visual-studio-2010-cant-see-bin-library-of-opencv

    Regards,

      Thorsten

    Tuesday, September 18, 2012 4:20 PM
  • yahh...similar issue but still i couldn't make it work sir... 

    i have try to paste the dll into system32 or the said solution on your post...

    hmm.. am i doing it wrong?..

    Tuesday, September 18, 2012 4:33 PM
  • yahh...similar issue but still i couldn't make it work sir... 

    i have try to paste the dll into system32 or the said solution on your post...

    hmm.. am i doing it wrong?..

    Try changing your project to target x86, not AnyCpu, in the build settings.  If your using a library that's expecting and trying to load the 32bit version of the DLL, this could be the problem.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, September 18, 2012 4:39 PM
  • yahh...similar issue but still i couldn't make it work sir... 

    i have try to paste the dll into system32 or the said solution on your post...

    hmm.. am i doing it wrong?..

    Try changing your project to target x86, not AnyCpu, in the build settings.  If your using a library that's expecting and trying to load the 32bit version of the DLL, this could be the problem.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    sir my build target is x86  build screen shot


    Tuesday, September 18, 2012 4:55 PM
  • If you look at the innerexception on the trace that will lead you to the root cause.  When programs start in CLR the loader attempts to locate the DLLS to run.  If it cannot find them you are out of luck.  There is a log the loader uses which can tell you where it looked to find the dll.  I think it's called the Fusion Log, easily found on internet.

    I am thinking the "Unable to load DLL" message may have something to do with that.  Keep in mind however, that no all DLLS are loadable as I have tried to load DLLs from 3rd party vendors before with no luck.  I think there are very specific rules on what DLLs the Fusion component can load.  There are two loaders, one for CLR and one for Native loads.  I don't know exactly how each one gets invoked but have seen both of them in WINDBG traces before.


    JP Cowboy Coders Unite!

    • Proposed as answer by Jason Dot Wang Thursday, September 20, 2012 5:30 AM
    • Marked as answer by Deo GM Cabral Tuesday, September 25, 2012 9:34 AM
    Tuesday, September 18, 2012 5:37 PM
  • Hi Deo,

      Welcome to MSDN Forum Support.

      Based on your descriptions on how to solve the problem about OpenCV, we can isolate that the issue is embraced by a http://opencv.willowgarage.com/wiki/VisualC%2B%2B.

      Sincerely,

      Jason Wang


    Jason Wang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, September 20, 2012 5:45 AM
  • it seems im missing a DLL i forgot the name... i just download a DLL downloader and it fixes the problem... hmm.. thanks for the help guys... :D
    Tuesday, September 25, 2012 9:35 AM