I’m using Visual Studio and while fiddling around with a custom control, I started
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There was a problem in the constructor of the custom control.
For some reason, calling Bitmap.MakeTransparent() on a bitmap that doesn’t have a transparent bit set, causes an out of memory error.
This was being reported in the designer, but without any of the actually relevant stack trace.
The solution was to comb through the custom control and make sure the constructor could never through an exception. One approach is to surround the constructor logic in the control with a try…catch, and report the error with Console.WriteLine. You’ll see it at runtime, with full stack trace.