Exceptions in designer - how to find?

Hi,

I have a control added to a form and whenever I open that form it tells me that an exception was thrown in the control and thus it's disabled in the form. However, I can't seem to find where this exception is thrown and everything is fine at runtime. Is there a way to break on exceptions at design time?

Thanks,

Tom

[334 byte] By [TomFrey] at [2007-12-17]
# 1
Yes, this can happen because the IDE tries to initialise your form in order to render it. Does the control have any properties that need to be set before it can display properly ? You may have to shuffle the code around a bit or provide something with a default value so the IDE can initialise your control and call it's paint method successfully.
cgraus at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# IDE...
# 2
You may want to use visual studio's debugger to debug your control when hosted in visual studio Smile

Check out the Debugging section in:
http://msdn.microsoft.com/msdnmag/issues/03/04/Design-TimeControls/default.aspx

Best regards,
Johan Stenberg

JohanStenberg at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# IDE...
# 3
well, I found out that I could debug with the immediate window. However, I can't find it? Is it not in Visual Studio 2005 Beta 2?
TomFrey at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# IDE...
# 4

The immediate window is included in Visual Studio 2005 beta2. You are most likely to find the command that opens the window in the Debug->Windows menu.

Best regards,
Johan Stenberg

JohanStenberg at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# IDE...
# 5
ahh, looked under View :/
Thanks
TomFrey at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# IDE...