How do we implement the OK/Submit button if the user chose his preferences and he is ready to start working on his new project? Furthermore - Cancel button - gracefully exit from the wizard and return to New Project dialog box without creating the project.
Asked
Active
Viewed 314 times
1 Answers
1
The IWizard interface (Microsoft.VisualStudio.TemplateWizard namespace) doesn't give you full control of the project creation. It allows you to do some things at specific phases of the project creation. It is cancelable throwing a WizardCancelledException. See also this explanation and also:
Pitfalls of cancelling a VSIX project template in an IWizard
If you want full control you can use the old COM-based IDTWizard interface (EnvDTE namespace) instead, which provides a single Execute method where you can show a form (cancelable) and add the project/files using EnvDTE.Solution.AddFromTempleate, EnvDTE.ProjectItems.AddFromTemplate, etc. See my post:

Carlos Quintero
- 4,300
- 1
- 11
- 18
-
Thanks for your reply Carlos. I was using your blog last two weeks extensively in order to properly develop my extension. I have already tried this article . But It is just throwing the exception without returning to the new project dialog box. I will try to implement the old IDTWizard interface – Vla Oct 21 '14 at 11:16
-
I have added a new link to the answer "Pitfalls of cancelling...". See if that helps because there are different WizardCancelledException and WizardBackoutException exceptions. – Carlos Quintero Oct 21 '14 at 12:00