Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my project, while accessing ‘NImage’ object for finding the image from file upload control,
I am getting the error as “The type initializer for 'Neurotec.Images.NImage' threw an exception.”
I have used the same all the dll of sample application of trial version of biometric photo detection tool in my project and added the reference for that ,still I am unable to find the solution
Posted
Updated 23-Dec-15 23:34pm
v2
Comments
Afzaal Ahmad Zeeshan 24-Dec-15 6:23am    
TypeInitializerException means that there was an exception raised in the constructor. Now, we have no idea for what it may be. It may be:
1) NullReferenceException
2) InvalidArgumentException
3) Similar ones...

So, check what is going wrong in the constructor. You may also check for the inner exception to find the problem that triggered this exception.

1 solution

Start by using the debugger, and closely examine the exception object - if you haven't done so yet, put a tray...catch block round the suspect code so that you can examine the exception in detail. Pay attention to any inner exception it contains.
If the NImage class is your own, then try stepping into the constructor and single step the code to see where the exception is first generated. If it isn't, then you need to look at your constructor parameters and work out if there is anything amiss there.

Sorry, but we can't do any of this for you: we can't run your code!
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900