Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the name of a dotnet new template when creating new projects?

I've created a dotnet template for use with dotnet new. When creating new projects from this template, it works fine however the assembly and namespace name is still "Template", rather than the new project.

I've tried creating a new project and manually setting the name with the --name flag and --output flag, but to no avail.

I suspect there's a variable I can use somewhere, perhaps in the template.json file?

Thanks,

like image 361
MM1010 Avatar asked Oct 16 '25 16:10

MM1010


1 Answers

You have to set template then use option params like -n param and give name. For example,

dotnet new web -n myBestName

you can see more about cli source click here

like image 150
Batuhan Kara Avatar answered Oct 19 '25 05:10

Batuhan Kara



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!