开发者

How do I set the Project's 'Start External Program' setting programmatically?

开发者 https://www.devze.com 2023-01-19 02:19 出处:网络
I have an IWizard which gets access to a Project variable. What code do I need to write to set the \'Start External Program\' value in project properties开发者_JAVA百科?Here\'s a macro that will set t

I have an IWizard which gets access to a Project variable. What code do I need to write to set the 'Start External Program' value in project properties开发者_JAVA百科?


Here's a macro that will set the current configuration to launch calc.exe. It should be trivial to re-work this for your IWizard implementation:

Dim project As Project = DTE.Solution.Projects.Item(1)
Dim config As Configuration = project.ConfigurationManager.ActiveConfiguration
config.Properties.Item("StartAction").Value = VSLangProj.prjStartAction.prjStartActionProgram
config.Properties.Item("StartProgram").Value = "C:\Windows\system32\calc.exe"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号