Link to home
Create AccountLog in
Avatar of AdibRahman77
AdibRahman77Flag for United States of America

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."}

    }
Avatar of andrewjb
andrewjb
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of Dmitry G
Dmitry G
Flag of New Zealand image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer