AdibRahman77
asked on
Type intializer error on Singleton class
Hi all
When I run the main windows application and create the following singleiton class I get the following error.
public class HDPaint
{
#region Singleton implementation
private HDPaint() { }
/// <summary>
/// Thread-safe singleton implementation
/// </summary>
public static readonly HDPaint currInstance = new HDPaint(); // error line
{"The type initializer for 'hdps.classLib.HdpsOrder' threw an exception."}
}
When I run the main windows application and create the following singleiton class I get the following error.
public class HDPaint
{
#region Singleton implementation
private HDPaint() { }
/// <summary>
/// Thread-safe singleton implementation
/// </summary>
public static readonly HDPaint currInstance = new HDPaint(); // error line
{"The type initializer for 'hdps.classLib.HdpsOrder' threw an exception."}
}
Run it in the IDE with break-on-exception enabled, and you'll find out what the problem is, won't you?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.