0

I have just started learning image processing with C# using EmguCv. I have downloaded the latest version of EmguCV i.e 3.4.1. When I try to create a Hello World program the following exception is generated.

System.TypeInitializationException

It says like type initializer for 'Emgu.CV.CvInvoke' threw an exception. I did follow all the steps of installation but still getting an error.

Can anyone please tell me the solution?

RBK
  • 558
  • 5
  • 16
  • 1
    what does the exception's `.InnerException.Message` say? – Marc Gravell May 10 '18 at 08:17
  • is it perhaps this one? https://stackoverflow.com/questions/17274372/the-type-initializer-for-emgu-cv-cvinvoke-threw-an-exception – Marc Gravell May 10 '18 at 08:18
  • I have even tried that but it is also not working –  May 10 '18 at 08:26
  • ok; so again: what is the `.InnerException.Message` ? – Marc Gravell May 10 '18 at 08:26
  • "The type initializer for 'Emgu.CV.CvInvoke' threw an exception." –  May 10 '18 at 08:30
  • that sounds like the outer `.Message`; did you check the `.InnerException.Message`? and if that didn't help, did you check the `.InnerException.InnerException.Message`? Somewere in the stack of nested exceptions there should be one that tells you what actually happened – Marc Gravell May 10 '18 at 08:48

1 Answers1

0

go to the properties of your project, in the build section just select the platform target according to your need. In my case I have selected x64 bit and it's working fine.

I got the same exception but when I do the above the problem got solved. Hopefully that helps

Lakshraj
  • 291
  • 2
  • 18