Search code examples
vb.netwinformsvisual-studio-2010designer

Windows forms designer broken in VS2010?


We've recently upgraded from VS2008 to VS2010. The conversion of our vb.net Windows Forms app went well, but we're now having big problems with the forms designer.

Pretty much any change to the layout of a form (sometimes just a solution rebuild) will work once, but on recompile, the IDE designer refuses to display the form, the error message being a null-reference exception (with no details as to what).

Closing and restarting VS2010 will cure it, but only for one compile cycle - and it's obviously not practical to close and reopen every time. Closing and reopening the form does not fix it.

We had these very occasionally before, if there was something wrong in the form's load event, or more rarely for random reasons, but since VS2008 SP1 this was never serious.

Whereas now with VS2010, it's now every form, every compile.

It's completely unworkable, and we've had to revert to VS2008 for winforms dev.

Any suggestions would be greatly appreciated..


Solution

  • You can debug design mode:

    • In project properties, in the debugger tab, set the name of the executable to devenv.exe.
    • Run/debug the project: this launches a 2nd copy of Visual Studio
    • Use the 2nd (being debugged) copy Visual Studio to open the form in design mode

    You may find more detailed information on the 'net, by Googling for 'debug design mode'.