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

Lukas Pirkl
  • 1,417
  • 3
  • 15
  • 31

1 Answers1

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

romanoza
  • 4,775
  • 3
  • 27
  • 44