sayedihashimi/template-sample

Renaming namespaces,Projects and namespaces with custom parameters.

Closed this issue · 2 comments

I would like to have an example on how to properly rename my solution, projects and namespaces with the custom entered parameters/symbols by the developers. Is it possible to change the corresponding parameter in the template.json, so I don't have to go through all files and change them there with the parameters?

For example I have a template where I can enter the following 3 parameters:
image

Now I would like those parameter to change the solution name too Keno.ProductName and my project to be named Keno.ProductName.FeatureName.

I know I can enter them here:
image

But the reason why I want to do it with the parameters, is to avoid misstakes by the developers or limit what they can enter with a choices parameter.

I hope I don't miss anything obvious.
Thank you for reading.

Typically the project name, or solution name for solution templates, comes from that text box. It uses sourceName for this and the New Project Dialog has support for that. It may be possible for you to use a parameter for this instead, but I think it may confuse the user and will be more work on your side because you'll have to define your parameter to have similar capabilities that sourceName has. I would advise against this approach. If you can use the functionality built in it would be better IMO.

There is guidance in the readme here for how to create a solution template. Let me know if this doesn't answer your question.

Thank you. I will play around a bit more with that then and do it the normal way.