I created imageHolder class:
public class ImageHolder : Image
{
private String imagePath;
public ImageHolder(String path):base(p
The TypeInitializationException (the exception that you are seeing) is thrown whenever a static constructor throws an exception, or whenever you attempt to access a class where the static constructor threw an exception - its InnerException property is the property that contains the detail of the exception that was actualy thrown - this is the exception that you need to investigate.
In this case from your screenshot the problem appears to be that the DLL "opencv_core240.dll" could not be found. This could be for a number of reasons
I'd suggest that you take a look at this question to see if any of the suggestions on there help you.
Checking this field did the trick for me. Under Project→ Properties→ Build (Main/Startup project)
I solved the problem by reinstalling MSVCRT 9.0 SP1 x86