如何修复错误 BC32035 - 属性说明符不是完整的语句?

问题描述 投票:0回答:1
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.  
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>

Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Me.cmd_View_Old_Notes = New System.Windows.Forms.Button
    Me.cmd_Save_Note = New System.Windows.Forms.Button
    Me.rpt_Viewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer

Visual Studio 2019 IDE 中的错误是

Severity    Code    Description Project File    Line    Suppression State
Error   BC32035 Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement. ProjectName PathToProject\frm_Main.vb   20  Active

我正在将旧项目从 Visual Studio 2005 更新到 VS2019。它使用 VB.Net

我无法在 DebuggerStepThrough()> 之后添加 _ 因为 VS2019 自动删除它

vb.net visual-studio winforms system.diagnostics
1个回答
2
投票

▶ 删除属性和该属性所应用的方法之间的空格/换行。

来自文档:

Error BC32035 - Attribute specifier is not a complete statement

(...) 属性块单独出现在源代码行上。 属性必须在声明的开头应用 声明,并且它们必须是该声明的一部分。 (...)

To correct this error

(...) 如果没有声明语句与该属性关联 块,要么提供一个属性块,要么删除属性块。 (...)

© www.soinside.com 2019 - 2024. All rights reserved.