4

Is it possible to change the Debug property of a project programmatically using EnvDTE classes? I know how to get the DTE instance, but I don't know how to change the value of this option. I need to change this property to be able to programmatically remove the vshost.exe file.

Screenshot of the option in question:

enter image description here

Sabuncu
  • 5,095
  • 5
  • 55
  • 89
  • Try running [this code sample](https://msdn.microsoft.com/en-us/library/envdte.project.properties.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2), with some luck it is included and you'll know the Property.Name. Some odds for "UseVSHostingProcess" but you have to fret over the configuration. – Hans Passant Mar 26 '16 at 06:38
  • Thank you, guy. It really works. – Andrew Snigur Mar 26 '16 at 11:27
  • Badaboom! Please close your question, tick the checkmark to the left of your post. – Hans Passant Mar 26 '16 at 11:47

1 Answers1

3

If someone will need the answer

Project proj = dte.Solution.Projects.Item(1);
Configuration config = proj.ConfigurationManager.ActiveConfiguration;
config.Properties.Item("UseVSHostingProcess").Value = false;