1

In a very large project I have inherited a form which also inherits other forms. The problem is when I try to view it in the designer it is showing me my custom error form!

I've tried enabling break on all errors and still it just displays my custom error form for a object not set.

How can I get the designer to show me the error location?

I've gone through all of the inherited forms and commented out the try and catch blocks in the hope it will show me the error to no avail.

Jay Croghan
  • 445
  • 3
  • 16
  • Visual inheritance is generally never a good idea, particularly for the buggy WinForms designer –  Jul 19 '18 at 06:04
  • @MickyD I agree however it's required in this instance. – Jay Croghan Jul 19 '18 at 06:50
  • Read [this post](https://stackoverflow.com/a/32299687/3110834) to make sure you have a good understanding about how windows forms designer works. – Reza Aghaei Jul 19 '18 at 08:27

1 Answers1

1

That is probably because the code corresponds to different windows form. I suggest you that before you delete an event(such as click event) from the code, delete the event in designer first to avoid errors.

You can run another instance of visual studio, open or createanother project, go to menu / Debug / Attach to process ... / select instance of devenv.exe process with problematic designer. Then press Ctrl+Alt+E to see the exceptions window, check "Thrown" in categories.

Now open visual studio with designer and try view designer. If an exception is thrown, you will see callstack and other typical information about your exception.

Mochuelo
  • 76
  • 7
  • 1
    Wow - 15 years of Visual Studio experience and this is my first time to debug visual studio with another visual studio. That worked like a charm and I found the issue, thanks. – Jay Croghan Jul 19 '18 at 06:49