Closed slofre closed 6 years ago
@slofre thanks for the issue. If I understand correct you want to author a new Wizard which shows a WPF dialog which can accept some parameter value, and then you want to pass that parameter value to the template during creation.
I haven't tried this myself. I'll chat with @phenning and @mlorbetske to see what needs to be done and then create a sample/video.
OK I looked into it a bit and now have a working sample. The files are in this folder. The key here is the name parameter that is added. The name of the parameter should be in the format passthrough:PARAMETER_NAME
where PARAMETER_NAME
is the name of the parameter in template.json
. For example for the copyrightName parameter the method call would look like the following.
replacementsDictionary.Add("passthrough:copyrightName", "value from wizard");
In the source.extension.vsixmanifest file make sure to list your wizard before the TemplateEngine wizard.
@sayedihashimi Thank you for quick response, your example was really helpful. Firstly I forgot to add both wizards in one time(custom and Microsoft) and second I did't know that I need to use "passthrough" with custom params. So, now it's working perfect. On more thing.. When I opened your sample and build that, I got an "Duplicate Assembly attribute" exceptions, so you can add next to .csproj to fix that:
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Thank you one more time!
Hi every one. I am trying to create multiple-project template with custom wizard to achieve next:
So, I follow this video to create Template pack https://www.youtube.com/watch?v=g6az_N95dVM&index=1&t=536s&list=PLqSOaIdv36hQdvGVkMXDJJ4Uh-nGj3NRK
After that I added new project with custom wizard(from msdn example): `public partial class TemplateWizard : IWizard { private WizardForm inputForm; private string customMessage;
Then added it to Assets via Assembly type and updated .vstemplate with next: `
` And yes, I tried sign assembly and token was't null, but it's doesn't matter.
As a result I am able to build vsix project and I see template in "File-> New Project". Then I can enter name, solution name and click "Ok". Then I see my Wizard, enter some text and close it. After that I see created solution, but it's empty. If I use default Microsoft Wizard, template works as expected and I see all projects that I need in solution.
So, how can I allow users input some parameters and after that successfully create not empty solution? I don't want copy all files manually in my wizard if I can avoid that. Any help, useful links or direction would be appreciated, thanks.