在Visual Studio宏中,如何在输出窗格(即通常包含构建输出的窗口)上编写执行信息?
我正在使用Visual Studio 2008,如果这是相关的。
解决方案:我在我的宏项目中添加了以下附件,我将它们发布在这里以防它们有用。
Private Sub Write(ByVal name As String, ByVal message As String)
Dim output As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
Dim window As OutputWindow = output.Object
Dim pane As OutputWindowPane = window.OutputWindowPanes.Item(name)
pane.Activate()
pane.OutputString(message)
pane.OutputString(Environment.NewLine)
End Sub
Private Sub Log(ByVal message As String, ByVal ParamArray args() As Object)
Write("Debug", String.Format(message, args))
End Sub
Private Sub Log(ByVal message As String)
Write("Debug", message)
End Sub