|
-
Jul 5th, 2002, 05:09 PM
#1
Thread Starter
Member
Please help (Type initializer threw exception...)
I'm getting a strange error when I try to add a UserControl to my WindowsForm when in design mode or if I try to view a form in design mode that already has the control. The error message is:
An exception occured while trying to create an instance of MyNamespace.Controls.ctrMyControl. The exception was "The type initializer for "MyNamespace.Classes.clsMyClass" threw an exception.".
Notice the odd puctuation (.".) at the end of the message. ctrMyControl is a UserControl and clsMyClass is a Class. Both are in the same Control Collection project. I can run programs that already contain the control. I just can't add or view the control when in design mode. Any ideas???
Thanks to anybody who can help!
-
Jul 5th, 2002, 05:29 PM
#2
Thread Starter
Member
yippie, I figured it out. I was initializing a modular-level String variable to Windows.Forms.Application.ProductName. I guess this is a bad thing to do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|