Tuesday, March 22, 2011

An unhandled exception ("System.MissingMethodException") occured in "ApplicationName" [22956]

In my day to day development work I faced this issue today. I am having a Class Library with several methods in it. This class library also takes several web service references. Now, I created a Console Application and take the assembly reference of this class library. And when I tried to run the Console Application, following error message is generated: 
An unhandled exception ("System.MissingMethodException") occured in "ApplicationName" [22956]


I got no clue after reading this message, since it is a very generic error message. I deleted the assembly reference and restarted the Visual Studio a couple of times. But no luck, the problem remains the same.


After following a reference on the net, I learnt that the Class Library I created should have at least one default constructor. Otherwise you may get this kind of ambiguous error message.


It saved my day!!!