From a17066c97b8e9ba8d8b88dcee0f97ad6151738fd Mon Sep 17 00:00:00 2001 From: XShine555 Date: Thu, 27 Aug 2026 22:01:37 +0200 Subject: [PATCH] Restructure template so solution files sit above the project folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AGENTS.md, CLAUDE.md and the .slnx now live at the root of the generated output, while the .csproj and other project-specific files (.editorconfig, source files) stay nested inside a subfolder named after the project. Single dotnet new invocation now produces: ProjectName/ ├── ProjectName.slnx ├── AGENTS.md ├── CLAUDE.md └── ProjectName/ ├── ProjectName.csproj └── ... Adds a post-action to register the generated project in the .slnx via 'dotnet sln add'. Verified end-to-end with a local dotnet new install. --- .template.config/template.json | 10 +++++++++- content/LabApiPluginTemplate.slnx | 2 ++ .../LabApiPluginTemplate/.editorconfig | 0 content/{ => LabApiPluginTemplate}/Config.cs | 0 content/{ => LabApiPluginTemplate}/EntryPoint.cs | 0 .../LabApiPluginTemplate.csproj | 5 ----- 6 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 content/LabApiPluginTemplate.slnx rename .editorconfig => content/LabApiPluginTemplate/.editorconfig (100%) rename content/{ => LabApiPluginTemplate}/Config.cs (100%) rename content/{ => LabApiPluginTemplate}/EntryPoint.cs (100%) rename content/{ => LabApiPluginTemplate}/LabApiPluginTemplate.csproj (93%) diff --git a/.template.config/template.json b/.template.config/template.json index 3764bb3..b0e7665 100644 --- a/.template.config/template.json +++ b/.template.config/template.json @@ -33,9 +33,17 @@ } }, "primaryOutputs": [ - { "path": "LabApiPluginTemplate.csproj" } + { "path": "LabApiPluginTemplate/LabApiPluginTemplate.csproj" } ], "postActions": [ + { + "description": "Adds the generated project to the nearest solution file, if one exists.", + "manualInstructions": [ + { "text": "Run 'dotnet sln add' manually to add the project to your solution." } + ], + "actionId": "D396686C-DE0E-4DE6-906D-291CD29FC5DE", + "continueOnError": true + }, { "description": "Restores the NuGet packages required by this project.", "manualInstructions": [ diff --git a/content/LabApiPluginTemplate.slnx b/content/LabApiPluginTemplate.slnx new file mode 100644 index 0000000..ba788ff --- /dev/null +++ b/content/LabApiPluginTemplate.slnx @@ -0,0 +1,2 @@ + + diff --git a/.editorconfig b/content/LabApiPluginTemplate/.editorconfig similarity index 100% rename from .editorconfig rename to content/LabApiPluginTemplate/.editorconfig diff --git a/content/Config.cs b/content/LabApiPluginTemplate/Config.cs similarity index 100% rename from content/Config.cs rename to content/LabApiPluginTemplate/Config.cs diff --git a/content/EntryPoint.cs b/content/LabApiPluginTemplate/EntryPoint.cs similarity index 100% rename from content/EntryPoint.cs rename to content/LabApiPluginTemplate/EntryPoint.cs diff --git a/content/LabApiPluginTemplate.csproj b/content/LabApiPluginTemplate/LabApiPluginTemplate.csproj similarity index 93% rename from content/LabApiPluginTemplate.csproj rename to content/LabApiPluginTemplate/LabApiPluginTemplate.csproj index dd0d5f8..14b8428 100644 --- a/content/LabApiPluginTemplate.csproj +++ b/content/LabApiPluginTemplate/LabApiPluginTemplate.csproj @@ -7,11 +7,6 @@ $(NoWarn);NU1701;MSB3277 - - - - -