Closed sayedihashimi closed 5 years ago
Just to make sure, at some point of the video, I guess you are referencing to the below line of code in ps1 to do folder exclusion?
$templateInfo | exclude-folder '.vs', 'artifacts', 'package', 'bin', 'obj'
Thanks for quick reply.
For solution level files you'll need to use a custom wizard. U can derive from existing wizard.
Also for files, they are all included by default, then excludes are processed.
If I understand correctly from your above comment, you can't embed a project within a solution folder then?
Not out of the box, you'll need to creates custom wizard. It should be pretty straight forward using the existing pecan-waffle wizard if you've done bs extensibility.
@sayedihashimi Hi, I am using pecan-waffel to create a .net core web template.. I can create a template but now i want to add wizard to it I added wizard library but it does not work.. is there any particular setup i have to do first.. would be great if there is a small sample code snippet
@clausthalVK what are you trying to do?
@sayedihashimi I need to create a .net core template..which needs to connect to one of our server and based on that information i need to generate some more file...static template works fine when i don't add wizard.. but when I add cutom wizard it doest not generate the structure.. could you please specify which class should i use for extensibility from pecanwaffel library
@clausthalVK pecan-waffle is implemented as a custom wizard see https://github.com/ligershark/pecan-waffle/blob/master/vs-src/PecanWaffle/PecanWizard.cs. Wizards are registered in the .vstemplate file for example https://github.com/sayedihashimi/pecan-waffle-samples/blob/master/templates/MyCustomTemplate/_project.vstemplate#L19.
If you create an additional custom wizard you can add it to your .vstemplate file after the pecanwaffle wizard. Note: I wouldn't run any custom wizards before the pecanwaffle wizard that creates files or does anything to the project. Adding wizards after should be OK for most cases.
The PecanWizard does some custom stuff so it's possible that this method won't work depending on the details of what you're doing. If you run into that problem then what I would recommend is to extend the PecanWizard, add your custom logic to that and then replace the wizard entry in the .vstemplate file to your own custom wizard.
@sayedihashimi thanks for your suggestion.. i have already done the same.. I have added my own wizard after pecanwaffle wizard. the only issue adding wizard after is that dictionary replacement added in second wizard are not included into pecanwaffle wizard.. but i have a work around for that ... I reall appreciate your nice work...pecan waffel has helped me alot
@clausthalVK ok great, glad to hear you got things working. Is your project open source? If so can you send me a pointer to the code?
For multi-project templates the recommend approach now is to use SideWaffle V2 (VS2017+)
FYI last week I made a video of creating vs templates with pecan-waffle https://youtu.be/ysvTROB963k.
If you're working on a multi-project template and having a hard time, I suggest you try pecan-waffle.