gpt4 book ai didi

visual-studio - 默认情况下,如何按构建顺序对 Visual Studio 的构建输出进行排序?

转载 作者:行者123 更新时间:2023-12-04 12:42:03 25 4
gpt4 key购买 nike

我知道我可以在 Visual Studio 中使用 对我的多核构建的构建输出进行排序。 build 订单 中的项目输出 窗口(如 here 所述)。
但是一旦我这样做并再次按 F7,选项就会切换回 。构建 我必须切换回 build 订单 再次。
有没有办法设置 build 订单 作为 中的默认设置输出 window ?
搜索一下,我发现这个问题被问了好几次,但从未回答:

  • http://ntcoder.com/bab/2009/06/02/ordering-output-of-out-of-order-builds-in-visual-studio/#comment-484
  • http://blogs.msdn.com/b/zainnab/archive/2010/07/03/show-the-output-window-during-build-vstiptool0045.aspx#comments
  • http://weblogs.asp.net/scottgu/archive/2005/10/21/428094.aspx#1451451

  • 编辑:
    answerSimon 给出对我有用(或者至少它为我指明了正确的方向),但我不能简单地复制他的代码并将其插入我的 MyMacros项目。相反,我必须为构建事件创建处理程序 正是 如所述 here :
    1. On the Class View explorer pane, in the Macros IDE, double-click the EnvironmentEvents node to display it as an EnvironmentEvents taband a drop-down menu on the macro editor pane.

    2. From the EnvironmentEvents drop-down menu, select an events type, such as TaskListEvents. The Declarations combo box is now populatedwith the available Task List events.

    3. On the Declarations drop-down menu, select an event, such as TaskAdded, to add its event procedure to the module.

    The event is inserted into your macro and you can now add code to the event procedure.


    否则,根本不会调用事件处理程序。

    最佳答案

    您可以编写一个 Visual Studio 宏,如下所示:

    Dim WithEvents MyBuildEvents as BuildEvents

    Private Sub BuildEvents_OnBuildBegin(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles MyBuildEvents.OnBuildBegin
    OpenBuildOrderOutputPane()
    End Sub

    Private Sub OpenBuildOrderOutputPane()
    Dim window As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput) ' Get Output Window
    Dim output As OutputWindow = CType(window.Object, OutputWindow)
    For Each pane As OutputWindowPane In output.OutputWindowPanes ' Browse panes
    If (pane.Guid = "{2032B126-7C8D-48AD-8026-0E0348004FC0}") Then ' Build Order guid
    pane.Activate()
    End If
    Next
    window.Activate()
    End Sub

    您需要将此代码粘贴到 MyMacros、EnvironmentEvents 模块中。

    关于visual-studio - 默认情况下,如何按构建顺序对 Visual Studio 的构建输出进行排序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13683543/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com