While I hope your error is solved as this is tagged under C# may I suggest looking at EMGU (www.emgu.com
]). It's a C# wrapper for OpenCV that thankfully is free and allows quick use of OpenCV functionality within a C# environment.
It will hopefully make your programming quicker and easier as you will not have to import the libraries and can simply reference the relevant .dll.
As the EMGU website is having difficulties at the moment you can acquire the source at sourceforge.net/
] please be aware that there are x86 and x64 versions available.