1

I'm trying to create a wizard for my project template by referring to this article.

https://learn.microsoft.com/en-us/visualstudio/extensibility/how-to-use-wizards-with-project-templates?view=vs-2019

I have done all the steps as in the documentation. But when I try to create a new project it doesn't show the form and it didn't use the updated version of the project template.

It gives following error.

enter image description here

RunStarted method looks like following:

public void RunStarted(object automationObject,
            Dictionary<string, string> replacementsDictionary,
            WizardRunKind runKind, object[] customParams)
        {
            try
            {
                // Display a form to the user. The form collects
                // input for the custom message.
                inputForm = new UserInputForm();
                inputForm.ShowDialog();

                customMessage = UserInputForm.CustomMessage;

                // Add custom parameters.
                replacementsDictionary.Add("$custommessage$",
                    customMessage);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }

You can check the full code here - https://github.com/kalpanibhagya/ProjectTemplateRacr

Kalpani Ranasinghe
  • 111
  • 1
  • 1
  • 11

1 Answers1

1

Issue was with the namespace in WizardImplementation.cs class in VSIX project. It was MyProjectWizard But it should be WizardRacr.

Kalpani Ranasinghe
  • 111
  • 1
  • 1
  • 11
  • Hi, @Kalpani Ranasinghe. Does this solution solve your problem? If it is solved, you can click ‘✔’ to accept it as an answer. It is helpful for community members to solve the similar problems. – Hui Liu-MSFT Jul 02 '21 at 03:03
  • @HuiLiu-MFST Yes, it solved the problem! Thanks for letting me know :) – Kalpani Ranasinghe Jul 05 '21 at 02:28