0

I have an error in my form editor preventing me from modifying the form.

I know in which control this occurs but no way to find what exactly causes the problem.

I tried setting breakpoints in the InitializeComponents() of the form I try to open but it doesn't stop (I am in debug mode...). I also tried to attach using a second instant of Visual Studio as demonstrated here, but even when setting all debug exception options to "throw", the attached process doesn't stop and indicate anything about call stack nor other useful information...

All I know is that there is a disposed object I'm trying to access, but absolutely no information as to where in code, etc..

What could I possibly do to debug the situation - knowing which control is the cause but absolutely no idea as to which of the 300 lines of code causes the issue...

neggenbe
  • 1,697
  • 2
  • 24
  • 62
  • What is the detailed error message? As you said that you couldn't modify the form, could you run it normally before if you didn't modify it? How did you modify it? Not really debug your app, could you run it using "start without debugging(Ctrl+F5)"? Please also make sure that no compiled error in the output or the error list window. – Jack Zhai Jun 08 '18 at 05:29
  • The error is "Reference not set to an object"... After MUCH digging, I found out that I inverted two lines of code in a control I'm using, bypassing it's initialize body... But still weird I was not able to catch the line of code generating this error, is it?! – neggenbe Jun 08 '18 at 09:17
  • Which VS version did you use? Do you enable the option "Enable the new Exception helper" under Tools->Options->Debugging after you enable the "Exception Settings" under menu Debug->Windows? Based on the error messages, without the project code, it is hard for us to really repro this issue. But if possible, you could share a simple sample using one drive. – Jack Zhai Jun 11 '18 at 08:44

0 Answers0