从加载项开始调试

时间:2013-10-31 19:23:35

标签: visual-studio-debugging visual-studio-addins

我正在制作VS加载项,它会更改调试命令行。 这部分有效,但我需要在更改后开始调试。

如何从加载项开始调试?

mybe来自此功能的东西可能有帮助

Function GetCommandArgsProperty() As EnvDTE.Property
    Dim solution As Solution
    Dim project As Project
    Dim sb As SolutionBuild
    Dim cm As ConfigurationManager
    Dim config As Configuration
    Dim properties As Properties
    Dim prop As EnvDTE.Property

    solution = _applicationObject.Solution
    sb = solution.SolutionBuild

    For Each str As String In sb.StartupProjects
        project = solution.Item(str)
        cm = project.ConfigurationManager
        config = cm.ActiveConfiguration
        properties = config.Properties

        For Each prop In properties
            If prop.Name = "CommandArguments" Then
                Return prop
            End If
        Next
    Next
End Function

1 个答案:

答案 0 :(得分:1)

让它运作

        Dim dte As EnvDTE.DTE = GetService(GetType(EnvDTE.DTE))
        dte.Solution.SolutionBuild.Run()