C
C#2y ago
McBacon

❔ Is it possible to add project template inside a solution/multi-project template in Visual Studio

Yes, of course you can have multiple projects under one solution 🙂
12 Replies
McBacon
McBaconOP2y ago
You can add them either by using CLI od VS 2022 In CLI type command dotnet sln YourSln.sln add YourProject.csproj (if C#) In VS Right Click on Solution in Solution Explorer -> Add -> New/Existing Project Wdym "`item template"?
McMahone
McMahone2y ago
Yes I know, but my question is specific to templates.
McBacon
McBaconOP2y ago
Do you want to have different project's e.g. console app proj and unit tests proj in one solution?
McMahone
McMahone2y ago
An item template can be a class template. Not exactly like that A project template example can be choosing ASP.net Web Api when you click on create project from visual studio. It then gives you a weather forecast example which already includes a controller, class, settings file and swagger
McBacon
McBaconOP2y ago
So you want a project and a class in one solution? For example ofc
McMahone
McMahone2y ago
yeah in a way, My solution will also be a template, and inside the solution I want to create different projects which are also in template format
McBacon
McBaconOP2y ago
May I ask why? 😄 I don't think it's possible according to official documentation
McBacon
McBaconOP2y ago
What are Visual Studio solutions & projects? - Visual Studio (Windows)
Learn about Visual Studio projects and solutions, how to create new projects from a template, and how to view & manage projects in Solution Explorer.
McMahone
McMahone2y ago
Templates are useful to cut repetitive work. Its a time optimization, so devs can concentrate on the actual logic it is very possible to create a solution template, but what I am wondering is if it possible to create project templates inside the solution template
McBacon
McBaconOP2y ago
Ok, I get it. Have you solved it?
McMahone
McMahone2y ago
No I still havent find a way to create templates inside a solution template
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity. Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?