Visual Studio Templates - custom parameters

前端 未结 2 1975
终归单人心
终归单人心 2021-01-28 18:02

I am using VS 2015 templates to create a project for me, within my C# classes I have substitutions like $projectname$ and they work great if I name my project like

2条回答
  •  -上瘾入骨i
    2021-01-28 18:25

    If you just want to generate a valid class name based on the project name, instead of creating a custom template parameter, you can change $projectname$ to $safeprojectname$, which is documented as:

    The name provided by the user in the New Project dialog box, with all unsafe characters and spaces removed.

提交回复
热议问题