ligershark / side-waffle

A collection of Item- and Project Templates for Visual Studio
Other
657 stars 205 forks source link

How to replace the name of a file when creating a template? #398

Closed 1TheMuffinMan closed 7 years ago

1TheMuffinMan commented 7 years ago

Using TemplateBuilder and the example project that creates two projects from a template I was wondering if there was a way to change the name of a file itself using $saferootprojectname$?

Here's my the main template project with the .vstemplate open for the particular project I want to change the file name in. You'll notice that I added a ProjectItem under the Project, which seems to be the way to accomplish this, however it keeps telling me it can't find the file.

example 1

Here's an image of the project template to show the structure: example 2

sayedihashimi commented 7 years ago

That looks like it should work. That said multi-project template can be very tricky. There is a new way to build multl project templates which is covered at https://youtu.be/ysvTROB963k. I think creating your multi project template with this new approach will be much easier. With that said I'm working with my team at Microsoft on the Template Engine. We don't have support to create templates for VS yet but we will in a few months. After that happens I'll re-direct you to create your template with that new approach, and that should stick for the long term.

1TheMuffinMan commented 7 years ago

@sayedihashimi Awesome news about the template engine. I'll close this and keep an eye on it.