【问题标题】:Change the Debug properties of Visual Studio project programmatically by EnvDTE通过 EnvDTE 以编程方式更改 Visual Studio 项目的调试属性
【发布时间】:2014-07-29 16:24:51
【问题描述】:

是否可以通过 EnvDTE 类以编程方式更改调试部分中的项目属性?我知道如何获取 DTE 实例并使用某些设置,但我是盲人或无法访问调试部分。我从这里开始http://msdn.microsoft.com/en-us/library/envdte.project.dte.aspx

【问题讨论】:

    标签: c# visual-studio envdte


    【解决方案1】:
    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";
    

    属性名称列表在这里:http://msdn.microsoft.com/en-us/library/aa984055(v=vs.71).aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-24
      • 1970-01-01
      • 1970-01-01
      • 2010-09-17
      • 1970-01-01
      • 2012-02-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多