You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dotnet new - Option to create solution implicitly when project is created #3782
Priority:2Work that is important, but not critical for the releasearea: authoringEnhancements to the process of authoring, maintaining, and testing templatesfeatureThe issue defines new feature.triage:transfer-to-sdkIssue should be transferred to dotnet/sdktriagedThe issue was evaluated by the triage team, placed on correct area, next action defined.
When a new project is created, can we consider an option to create a new solution as well ?
I can think of two workflows for new project creation:
(a) Adding a new project to an existing cohort of projects (which may already contain a solution)
(b) Instantiating a brand new cohort of project(s), which could use a solution file for working with IDE.
I'm interested in improving the experience of the second (b) workflow, which works like this today:
dotnet new $template
dotnet new sln
dotnet sln add $project// Use sln
I'd like to propose a switch addition to dotnet new <TEMPLATE> - --create-solution | -sln - which will much like dotnet new sln.
The updated dotnet new would look like this:
dotnet new <TEMPLATE> [--dry-run] [--force] [-lang|--language {"C#"|"F#"|VB}] [-sln|--create-solution]
[-n|--name<OUTPUT_NAME>] [-o|--output<OUTPUT_DIRECTORY>] [Templateoptions]
dotnet new -h|--help
For example, dotnet new classlib -sln would generate classlib.csproj as well as classlib.sln, and classlib.csproj to classllib.sln.
Similar to dotnet new sln, if a solution file already exists in the location, an error would occur.
This workflow is available today through the DotnetTemplateMCP MCP server's template_compose tool, which chains multiple template operations in a single orchestrated call.
The exact workflow from this issue (project + solution + sln add) becomes:
Priority:2Work that is important, but not critical for the releasearea: authoringEnhancements to the process of authoring, maintaining, and testing templatesfeatureThe issue defines new feature.triage:transfer-to-sdkIssue should be transferred to dotnet/sdktriagedThe issue was evaluated by the triage team, placed on correct area, next action defined.
Activity
vlada-shubina commentedon Dec 6, 2022
Can be addressed by #3208.
YuliiaKovalova commentedon Mar 3, 2026
This workflow is available today through the DotnetTemplateMCP MCP server's
template_composetool, which chains multiple template operations in a single orchestrated call.The exact workflow from this issue (project + solution + sln add) becomes:
This creates the project, creates the solution, and wires them together — equivalent to the proposed
dotnet new classlib -sln.For more complex scenarios (API + test project + solution), the same tool scales:
See also the related comment on #3208: #3208 (comment)
Source: DotnetTemplateMCP | NuGet