Error in "Form.vb [Design]"

I will try to develope a little application with Visual Basic.Net 2005 Beta 2.
I've make Form1 and its code, but at this time I can't see it in design time, an error occured:

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Clicking on each error will take you to the line of code that caused it.

Method 'System.Drawing.SizeF.op_Implicit' not found.
Hide

at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

What's happen, if I start debug, no error occure, the code is wright, the "myProgram.exe" start and work correctly, but i can't see the design time of Form1 and Form2.....
Tongue Tied




Answer this question

Error in "Form.vb [Design]"

  • Chris McCabe

    I dont copy any controls from one form to another .. the error occurs random and i can't relate it to any series of actions i do. It even occurs when i just open a saved project not editing it but just viewing a form in design view.


  • nishu

    None of the work arounds worked for me!

    • The 'Reset toolbox' has absolutetly no effect at all.
    • The 'new Form' hack just gives me the same error-message in both Forms.

     KathTam_MS:

    I do remember seeing the warning:

    'Public Overridable Property AutoScaleBaseSize() As System.Drawing.Size' is obsolete: 'This property has been deprecated. Use the AutoScaleDimensions property instead. http://go.microsoft.com/fwlink/ linkid=14202'

    Later when I tried to view the designer I got the reported error message:

    One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. Clicking on each error will take you to the line of code that caused it.


    Method 'System.Drawing.SizeF.op_Implicit' not found.

    Hide


    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

    A few facts:

    1. I'm running 2005 Beta 2.
    2. The project is in a solution with 7 small projects total.
    3. Everything is converted from a 2003 Solution.

    I hope you can solve this fast - thanks :-)

    -Claus

    EDIT:

    === Edited by Beeblebrox_dk @ 11 Jan 2006 5:38 PM UTC===
    I just tried overwriting the reported faulty code:

            Me.AutoScaleDimensions = New System.Drawing.Size(5, 13)

    With this:

            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

    And that did the trick :-) Now I can open the designer without errors. However, now the warning about 'AutoScaleBaseSize' being obsolete has returned.

    -Claus

     

     


  • Utkarsh

    Interesting, this should not happen.
    Mauro, if you have time to zip your project and send it to me at lucad@microsoft.com I could take a look and see what it is happening.

    Luca Dellamore
    Visual Basic Test Team

  • ursus zeta

    Yes I get the error from an upgraded Visual Studio 2003 project. It only happen to 1 out of 33 forms in a large vb.net solution.

    '.ctor' is not a valid identifier.

    at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomEventBindingService.ValidateMethodName(String methodName)
    at System.ComponentModel.Design.EventBindingService.EventPropertyDescriptor.SetValue(Object component, Object value)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAttachEventStatement(IDesignerSerializationManager manager, CodeAttachEventStatement statement)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement).

    The question is, how to fix the problem.  I've made changes to include

    Me.AutoScaleDimensions = New System.Drawing.SizeF(120.0!, 120.0!)

    Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi

    The form includes lots of user / third party controls. I'm not sure providing the code to the testing team will be possible without breaking our confidentiality agreement with the IP owners.



  • EdgarGustavoPerezGonzalez

    I was having a similar problem:
    One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.....

    The problem was resolved when I went to window->Close all documents. There seems to be a problem if you have other forms open.
    ymmv

    Good luck,
    Jay

  • mbelew

    I have the same problem over and over. Even with a fresh system with only .NET Studio 2005 installed with C# projects created in VS .NET 2005. I hope there will be a solution to this problem soon!
  • computed_mind

    Not that I am aware of but if you have a project that repro the issue feel free to send it my way. Are you using Beta2 too

    Luca Dellamore
    Visual Basic Test Team


  • Vahid Nourbin

    Hi all,

    In order to solve this problem, right click inside the Toolbox Window and press <Reset Toolbox>, this will do the job.

    Regards,


  • aze

    I meet the same problem just like you.
    Do you copy controls between two UI designers   I do this, I think that it is proberbly relate with this.  But i don't know how to solute it. 
    Sad

  • RHTCJohn

    G'day,

    The simple answer to my own question, "how to fix the problem ", is

    1. Create a new windows form,
    2. Copy the #Region " Windows Form Designer generated code " Into the a new forms *.Designer.vb file and
    3. Copy the rest of the VB code in to a new *.vb file. 
    4. Every thing then works "like magic" again.

     



  • DelWare

    Try doing a repair on vs.net 2002 beta 2.

    Ken



  • pr0gr4m3r

    Btw - Was this project upgraded from Visual Studio 2002 or 2003

    There seems to have been repors of this error happening due to some bug with the AutoScale Mode property.

    Do you remember seeing any warnings in your task list that look like this

    'Public Overridable Property AutoScaleBaseSize() As System.Drawing.Size' is obsolete: 'This property has been deprecated. Use the AutoScaleDimensions property instead. http://go.microsoft.com/fwlink/ linkid=14202'

     

    thanks in advance,

     

     



  • Leonardo Cantelmo

    There seems to be some quirkiness with upgraded projects and the Auto Scale properties.

     

    I'm glad you discovered a workaround but it looks like we should investigate this a bit more from the Development and Test team.  I'll make sure we are aware of this issue

    thanks for being so patient!

     



  • Nemanja Trifunovic

    I'm having the same problem   Have we found a solution   tready@cat.com
  • Error in "Form.vb [Design]"