output file path from a build

I can complie a project using IVsBuildableProjectCfg.StartBuild method. But I am not able to locate the interface (method) that would give me the output filepath. I would like to know the full path of the output.

Thanks.



Answer this question

output file path from a build

  • Gafrage

    The OutputPath is actually a property of the project.

    Have you seen the ProjectConfigurationProperties interfaces The ProjectConfigurationProperties3 members can be found http://msdn2.microsoft.com/en-us/library/vslangproj80.projectconfigurationproperties3_members.aspx
    and it has the outputpath as one of its properties.



  • programmer01

    From your question it is not clear whether you have your own project type using the MPF Project base classes or you are getting the interface from one of the language projects (C#/VB). Assuming it is not you own project I would use the automarion model to get to the output path for the active configuration. e.g.

    EnvDTE.Project project = ....

    EnvDTE.Configuration activeConfig = project.ConfigurationManager.ActiveConfiguration

    string outputpath = activeConfig.Properties.Item("OutputPath").Value.ToString()

    string outputFileName = project.Properties.Item("OutputFileName").Value.ToString()

    string fullPath = Path.Combine(outputPath,outputFileName)

    /Ole


  • Ravi Kite

    You have two choices. One is to get the output groups for the item, find the built output group, then find the first output. You could also use the automation model. The following macro will show how to do it:

    Public Sub FindOutputDirectory()

    Dim proj As Project

    Dim config As Configuration

    proj = DTE.Solution.Projects.Item(1)

    config = proj.ConfigurationManager.Item(1)

    MsgBox(System.IO.Path.GetDirectoryName(proj.FullName) + "\" + config.Properties.Item("OutputPath").Value + proj.Properties.Item("AssemblyName").Value + ".exe")

    End Sub



  • output file path from a build