locked
How to get project path to exe folder from dte RRS feed

  • Question

  • I write a Visual Studio Extension (Vsix).

    What I have done so far:

    I have a console app which display a generated string when is executed

    The Console App is being running from my plugin. -> i need that path to start process in different way to get output from the console.

    I need to find current running external project path to exe.

    My code:

    private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
    
            // This runs my external console application
            dte.Solution.SolutionBuild.Run();
    
            Path.GetDirectoryName(dte.Solution.FullName);
            Project prj = dte.Solution.Projects.Item(1);
            string  msg2, msg3 = "";
            msg2 = prj.DTE.FullName;
            msg3 = prj.DTE.FileName;
          
        }

    Currently project which runs application is devenv.exe so:

    Path.GetDirectoryName(dte.Solution.FullName) = "D:\user\proj\projName\Docs\App\AppName"

    msg2, msg3 = "D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe"

    I need ExecutablePath smth like this "D:\user\proj\projName\Docs\App\AppName\bin\debug\app.exe"

    Wednesday, September 16, 2020 9:20 AM

All replies