简体   繁体   English

vb.net代码行编号工具?

[英]vb.net in-code line numbering tool?

I'm looking for a tool (addon or something) for visual studio 2013 to add in-code line numbers for visual basic code (the ones to use with the "erl()" function). 我正在寻找用于Visual Studio 2013的工具(插件或其他工具),以为Visual Basic代码(用于“ erl()”函数的代码)添加代码行号。

I've been using mztools on vs2010, which is great, I have bought a license for 2010 but now I have to buy a new one to use in visual studio 2013 and I don't want to spend $75 (again) to use the line numbering tool and try-catch templates. 我一直在vs2010上使用mztools,这很棒,我已经购买了2010年的许可证,但是现在我必须购买一个新的许可证才能在visual studio 2013中使用,我不想再花费75美元来使用行编号工具和尝试捕获模板。 Any alternative? 还有其他选择吗?

Thank you! 谢谢!

Have you looked at the new caller information attributes that are available as of VS 2012? 您是否查看了自VS 2012起可用的新呼叫者信息属性?

Example taken from MSDN at this page. 从MSDN在采取例如这个页面。

' Imports System.Runtime.CompilerServices 
' Imports System.Diagnostics 

Private Sub DoProcessing()
    TraceMessage("Something happened.")
End Sub 

Public Sub TraceMessage(message As String,
        <CallerMemberName> Optional memberName As String = Nothing,
        <CallerFilePath> Optional sourcefilePath As String = Nothing,
        <CallerLineNumber()> Optional sourceLineNumber As Integer = 0)

    Trace.WriteLine("message: " & message)
    Trace.WriteLine("member name: " & memberName)
    Trace.WriteLine("source file path: " & sourcefilePath)
    Trace.WriteLine("source line number: " & sourceLineNumber)
End Sub 

' Sample output: 
'   message: Something happened. 
'   member name: DoProcessing 
'   source file path: C:\Users\username\Documents\Visual Studio 2012\Projects\CallerInfoVB\CallerInfoVB\Form1.vb 
'   source line number: 15

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM