question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect designer generation for VB when last property of a component is of string type

See original GitHub issue

Environment

Visual Studio 2022 version 17.5.0

.NET version

6.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

Visual Studio 2022 version 17.4.5

Issue description

When last property of a component is of a String type, then it not insert new line character and the comment of next section get on the same line, for example, look the single quote of Form1 comment right after “Label1”:

Private Sub InitializeComponent()
    Label1 = New Label()
    SuspendLayout()
    ' 
    ' Label1
    ' 
    Label1.AutoSize = True
    Label1.Location = New Point(413, 91)
    Label1.Name = "Label1"
    Label1.Size = New Size(41, 15)
    Label1.TabIndex = 0
    Label1.Text = "Label1"' 
    ' Form1
    ' 
    AutoScaleDimensions = New SizeF(7F, 15F)
    AutoScaleMode = AutoScaleMode.Font
    ClientSize = New Size(800, 450)
    Controls.Add(Label1)
    Name = "Form1"
    Text = "Form1"
    ResumeLayout(False)
    PerformLayout()
End Sub

Steps to reproduce

  • Create new Windows Forms application with Visual Basic
  • Place a Label componente on the Form
  • Save

Diagnostics

No response

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ehasiscommented, Mar 21, 2023

Tested with 17.5.3 and now is working as expected. Thanks!

1reaction
KlausLoeffelmanncommented, Feb 24, 2023

We have fixed this already in a later version of VS. We’re currently thinking about servicing a couple of issues around VB, including this one, to 17.5.

Leaving this open for visibility, until we finally decide. @merriemcgaw FYI.

Thanks for your engagement!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect designer generation for VB when last property of ...
Incorrect designer generation for VB when last property of a component is of string type #5872. Sign in to view logs · Sign...
Read more >
Visual studio shows endless messages "Code generation ...
When in design view in Visual Studio; a control instance is created to render it on the visual editor, but if the control...
Read more >
Design-time errors - Windows Forms .NET
This error is a problem with a third-party component. Contact the component vendor. Cannot access the Visual Studio Toolbox at this time. Visual ......
Read more >
Work with Variables and Types
Here are the different types of variables available in Visual Builder: Primitive variables such as String, Number, Boolean, even a wildcard-type Any. Structured ......
Read more >
The 10 Most Common Mistakes in C# Programming
Many (but not all) value types have an IsEmpty property which you can check to ... Common C# Programming Mistake #3: Using improper...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found