locked
Visual Studio Windows Forms Designer Issue RRS feed

  • Question

  • Hi

    We are all well used to the fact that the Windows Forms designer in Visual Studio has been buggy for years (since Visual Studio 2005, if I remember right). Just to make us feel at home, the Windows Forms designer in 2013 is equally awful.

    Currently, I have a form which is listing 19 errors preventing it from being actually designed (Could not find type MyAppName.CustomComboBox, the variable 'DayComboBox' is either undeclared or never assigned, et. etc.).

    I was able to run this form fine last night, and designer was fine, but today (with no changes made) - Nope - no go.

    I've tried the usual several times of close the designer and reopen, but still no go.

    I've closed Visual Studio 2013 and reopened the project and offending file, still no go.

    I've gone into designer.vb, and as far as it is concerned none of the errors exist.

    I can execute the form fine, everything still works.

    But I can't do any work on the interface now...

    I've had to recreate forms from scratch before now with similar issues - but Microsoft don't actually seem to get the fact that I have a job - other than dealing with stupid Visual Studio bugs - to get on with. Thankfully very little of my development is now in Windows forms, as Microsoft clearly treat is as the poor relation when it comes to pre-release testing, going by the number of bugs in it (just don't get me started on the dataset designer!).

    Has anyone any bright ideas I've missed, before I go absolutely spare and start dancing round the office singing very rude songs about Microsoft?

    Many thanks.

    Niki


    Niki


    • Edited by NikiR Tuesday, November 26, 2013 12:57 PM typo
    • Moved by Amanda Zhu Wednesday, November 27, 2013 2:06 AM More related
    Tuesday, November 26, 2013 12:57 PM

Answers

  • Now if anyone can suggest a way to force garbage collection, or some other way to ripple things through properly, that would be immense!

    You can force immediate garbage collection by calling GC.Collect.
    • Marked as answer by Barry Wang Tuesday, December 31, 2013 10:01 AM
    Wednesday, November 27, 2013 1:30 PM
  • Did you ever use the Document.Outline. Mostly you see then why this kind of things happen in a glance. 

    View -> Other Windows -> Document Outline or simply Ctrl Alt T


    Success
    Cor


    • Edited by Cor Ligthert Wednesday, November 27, 2013 4:47 PM
    • Marked as answer by Barry Wang Tuesday, December 31, 2013 10:01 AM
    Wednesday, November 27, 2013 4:46 PM

All replies

  • I'm sorry you're so frustrated.  It can be challenging to solve problems in a frustrated state.  Reaching out for help is a good strategy.

    Adding properties to a form will add code to the designer to initialize values for new instances of the form (including those used by vshost.exe in the designer).  If you have any code in your form (which you likely do) then make sure you don't cause exceptions when you get bogus data.  Sometimes the designer will conjure up a value for a property that you weren't expecting. Other times it's as simple as disabling design-time features by checking at run time if the "DesignMode" property is true and bailing out early from a Paint method or Load method.

    Convincing yourself that gremlins appeared overnight and now it's broken because of nothing you did is not going to be a productive approach.  Try not to think like that.  Instead, focus on the exception you are getting.

    The designer's exception is displayed, and will usually tell you exactly what the problem is.  It seems like you're just hand-waving away the fact that the designer is reporting an error.  It's relevant, don't ignore it.

    From your description it sounds like it's complaining that some types were not found.  Can you create a new test form that uses that type.  This will confirm that the type exists and will give you something that works to compare to so that you can bisect the problem with your form.

    Also, maybe you can look for tips and information about using the debugger to debug debugging design-time issues.

    Tuesday, November 26, 2013 1:33 PM
  • Hi,

    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor.

    I agree with Wyck. We can focus on those errors to resolve your issue.

    Since your issue is on Windows Forms designer, I am moving your questions to Windows Forms General forum for better support and solution.

    Thanks,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 27, 2013 2:05 AM
  • Hi

    Walking away from the PC before I beat it to death did the trick.

    Not for the first time, simply leaving the system to sit there allows Visual Studio to get it's act in gear (garbage collection or something?).

    In the past, it's always centred on datasets (make a minor change - e.g. add a new query - to an existing dataset using the dataset designer and suddenly the system insists that either the dataset doesn't exist, or when you try to load data it doesn't work).

    This is the first time that I've had form designers fall over (as I said in original post, the designer.vb wasn't listing any errors with the types, but the visual designer was!).

    Oh well, chalk it up to experience (though I doubt if my boss will believe that the reason I'm taking an hour out from development is to allow Visual Studio to wake up and smell the coffee!).

    And even the dataset problems only occur in Windows development. Clean, rebuild, restart VS - none of them work.

    Now if anyone can suggest a way to force garbage collection, or some other way to ripple things through properly, that would be immense!


    Niki

    Wednesday, November 27, 2013 10:33 AM
  • Now if anyone can suggest a way to force garbage collection, or some other way to ripple things through properly, that would be immense!

    You can force immediate garbage collection by calling GC.Collect.
    • Marked as answer by Barry Wang Tuesday, December 31, 2013 10:01 AM
    Wednesday, November 27, 2013 1:30 PM
  • Did you ever use the Document.Outline. Mostly you see then why this kind of things happen in a glance. 

    View -> Other Windows -> Document Outline or simply Ctrl Alt T


    Success
    Cor


    • Edited by Cor Ligthert Wednesday, November 27, 2013 4:47 PM
    • Marked as answer by Barry Wang Tuesday, December 31, 2013 10:01 AM
    Wednesday, November 27, 2013 4:46 PM
  • Thank you both, Wyck and Cor - I'll try both things next time !

    I'll leave this open for another day or so, just in case someone actually knows what causes VS to get out of step with itself, otherwise I'll mark Wyck as answer (purely because he got there first, with the garbage collection answer!).


    Niki


    • Edited by NikiR Thursday, November 28, 2013 8:53 AM
    Thursday, November 28, 2013 8:50 AM