Article ID: 315487 - View products that this article applies to.
This article was previously published under Q315487
This article has been archived. It is offered "as is" and will no longer be updated.
The sample code provided in this article demonstrates how to use the LaunchWizard method of the DTE object to run an existing Microsoft Visual Studio .NET Wizard.
The DTE.LaunchWizard method requires two arguments when used to run a new project wizard. The first argument is the name of the wizard file (.vsz file). The second argument is an array of values that is passed to the wizard when it runs. When you set the seventh element of the array to True, you can force the errors to throw exceptions, which may be caught in a try...catch structure. The New Windows Application Wizard expects the following values in the array:
NOTE: The macro uses the Silent flag when calling the wizard. If you run this macro once, it runs without error, provided that the directory and project do not already exist. If you run this macro a second time, an error is raised. Because the Silent flag is set to True, an exception is caught by the try...catch block.
For additional information about the Wizard type, search on ContextParams Enum in Books Online.
For more information about troubleshooting Visual Basic .NET and Visual C# extensibility, browse to the Microsoft Web Help file at the following Microsoft Web site: