templating icon indicating copy to clipboard operation
templating copied to clipboard

Variable Solution name and Project name

Open issafram opened this issue 7 years ago • 3 comments

I have a template which looks like this:

  • TopLevelFolder
    • HelloWorld.sln
    • Other important files (needed for builds, deployments, etc)
    • .nuget.config
    • HelloWorldFolder
      • HelloWorld.csproj
      • .cs files
      • Controllers
        • SomeController.cs

My template currently works where I can change namespaces depending on the -n input parameter using the sourceName value in template.json.

But the parameter doesn't rename the solution name, project folder, and csproj files (bolded above).

How could I go about achieving that?

Thanks I appreciate any help

issafram avatar Apr 22 '19 17:04 issafram

Never-mind I wasn't thinking straight.

issafram avatar Apr 22 '19 17:04 issafram

I have this same question - not sure why you took your question back, but I'd love to be able to rename the solution and folders just like you are asking. Can you tell me how you solved this?

mtrtm avatar Oct 12 '20 18:10 mtrtm

Figured it out - if you use sourceName in your template.json and set the value to "Example", and when on the CLI you pass in the name flag with the value test, you will see that Example is replaced with test everywhere in your project - file names, folder names, and within code as well.

mtrtm avatar Oct 14 '20 17:10 mtrtm