Ответ 1
Макро ниже должно помочь. Откройте "Tools- > Macros- > Macro Explorer", затем создайте новый модуль, отредактируйте его и скопируйте вставьте код ниже. Обязательной командой является SetCommandArgsProperty. Пользовательский интерфейс не очень приятный, но он работает (VS 2005, надеюсь, это будет работать и в VS 2010). Затем добавьте любой ярлык, который вам нравится для запуска этого макроса.
Вот несколько деталей:
- Найти проект запуска
- Выберите активную конфигурацию и найдите свойство с именем "CommandArguments"
- Создать поле редактирования с текущим значением в нем
-
Обновить свойство, если выбрано OK
Sub SetCommandArgsProperty() Dim newVal As Object newVal = InputValue(GetCommandArgsPropertyValue()) If TypeOf newVal Is String Then SetCommandArgsProperty(newVal) End If End Sub Function InputValue(ByVal defaultText As String) Dim frm As New System.Windows.Forms.Form Dim btn As New System.Windows.Forms.Button Dim edit As New System.Windows.Forms.TextBox edit.Text = defaultText edit.Width = 100 btn.Text = "OK" btn.DialogResult = System.Windows.Forms.DialogResult.OK frm.Text = "Input command line properties" frm.Controls.Add(btn) btn.Dock = System.Windows.Forms.DockStyle.Bottom frm.Controls.Add(edit) edit.Dock = System.Windows.Forms.DockStyle.Top frm.Height = 80 frm.Width = 300 If frm.ShowDialog() = System.Windows.Forms.DialogResult.OK Then Return edit.Text End If Return System.DBNull.Value End Function Function GetCommandArgsProperty() As EnvDTE.Property Dim solution As Solution Dim project As Project Dim sb As SolutionBuild Dim str As String Dim cm As ConfigurationManager Dim config As Configuration Dim properties As Properties Dim prop As EnvDTE.Property solution = DTE.Solution sb = solution.SolutionBuild For Each str In sb.StartupProjects project = solution.Item(str) cm = project.ConfigurationManager config = cm.ActiveConfiguration properties = config.Properties For Each prop In properties If prop.Name = "CommandArguments" Then Return prop End If Next Next End Function Function GetCommandArgsPropertyValue() Return GetCommandArgsProperty().Value End Function Sub SetCommandArgsProperty(ByVal value As String) GetCommandArgsProperty().Value = value End Sub