Does VB.NET not allow line continuations over commented-out lines?

前端 未结 2 1420
你的背包
你的背包 2021-01-12 20:30

I just had this throw a compilation error while refactoring some legacy (hence VB.NET) unit tests, where I wanted to just comment out one of the sample inputs to MBUnit:

2条回答
  •  失恋的感觉
    2021-01-12 21:26

    I have a .[Rem] extension method to allow the in-place "commenting out" of fluent expressions. You could create a [Rem] attribute to do the same thing.

     _
    <[Rem](" _")> _
     _
    Sub Main
    
    End Sub
    
    ' Define other methods and classes here
     _
    Class [Rem]
        Inherits Attribute
        Public Sub New()
        End Sub
        Public Sub New(Comment As String)
        End Sub
    End Class
    

提交回复
热议问题