Hi All,

I come across some problems on the designer.

In my project, some segment of code will make the UI designer get serialization error, is there any method to make the designer to skip these lines of code in design time as there is no error at all in runtime.

Is there any attributes, such as [STAThread], can make a method skipped by the designer

I have been trapped for a long time on this. Any help will be highly appreciated.

Re: Visual C# IDE Question on VS2005 designer


The designer only invokes a few method calls automatically. In all other cases it simply sets property values. Can you be more specific about what error is being raised, what method is causing the problem and perhaps post some of the code causing the problem

Michael Taylor - 8/28/07

Re: Visual C# IDE Question on VS2005 designer


I have come acrosss many instances of the designer failing to open a form when there is alot code in the load event of the form.

Comment out your code in the load and init methods and see if it stops your problems.

There is a way to make code only execute when not in design mode which is the solution for now however I can't remember the command.

You might as well check and see if this is the problem first of all.