Change the Debug properties of Visual Studio project programmatically by EnvDTE
Asked Answered
E

1

5

Is it somehow possible to change the project properties in debug section programmatically by EnvDTE classes? I know how to get the DTE instance and work with some of the settings, but I am blind or the debug section is just not accessible. I started from here http://msdn.microsoft.com/en-us/library/envdte.project.dte.aspx

Screenshot of the properties

Existence answered 29/7, 2014 at 16:24 Comment(0)
C
11
EnvDTE80.DTE2 dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.12.0");
Project project = dte2.Solution.Projects.Item(1);
Configuration configuration = project.ConfigurationManager.ActiveConfiguration;
configuration.Properties.Item("StartAction").Value = VSLangProj.prjStartAction.prjStartActionProgram;
configuration.Properties.Item("StartProgram").Value = "your exe file";
configuration.Properties.Item("StartArguments").Value = "command line arguments";

The list of property names is here: http://msdn.microsoft.com/en-us/library/aa984055(v=vs.71).aspx

Colitis answered 7/8, 2014 at 12:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.