0

I'm currently building in work a Base code structure for C# API microservices. In future, we will surely make more of these, so I would like create something like "base project or something like this".

I am aware there is system of Project Templates in C#, but from what I learned on tens of pages, I didn't come to solution from which I would be happy. I would like to build it in to single template file, which everyone can download, import and start with it... I always ended up with template imported directly from source to dotnet templates and couldn't find the generated template file. How can I make it? (I'm using JetBrains Rider not VS).

Or is there another techniques how to prepare some base skeleton?

sommmen
  • 6,570
  • 2
  • 30
  • 51
Zechy
  • 45
  • 12

1 Answers1

1

You could ofcourse just create the project and then share that around. Then people can then simply copy that project and rename it to use it like a template.

There is of course also file templates, but that is designed to be used inside a project already: https://www.jetbrains.com/help/rider/Templates__Applying_Templates__Creating_Files_from_Templates.html

It seems that in rider2017 and later, project templates are also supported however: https://blog.jetbrains.com/dotnet/2017/12/21/project-templates-rider-2017-3/

sommmen
  • 6,570
  • 2
  • 30
  • 51
  • Yep, they are, thats not the problem. The main reason I was mentioning Rider was, that a VS has some import/export tool for this templates directly. Then, there is code aproach throught dotnet in cli, but with this I am ending with creating that template inside dotnet. But yea, I can share that project with notes, how to make template from it. – Zechy Aug 03 '20 at 06:57
  • 1
    @Zechy in vs project templates are added through .vsix files so you can't install them to rider. But in our app we have large framework and several customer projects. When we're building something new we simply copy over the old project. Maintaining a project template is too cumbersome. Just be sure the time you're investing is worth it in your case. – sommmen Aug 03 '20 at 07:03
  • That also true, and we usually have so much changes... So I will probably go through the project sharing only without template. – Zechy Aug 03 '20 at 07:07