Open
Conversation
# Visual Studio Templates (#908) ## Summary Implements Visual Studio item/project template support for Krypton, enabling users to create Krypton-first forms and projects directly via **New Item** and **New Project** workflows. This addresses the feature request in [#908](#908). ## Why Previously, users typically started from standard WinForms templates and converted forms to Krypton manually. This change reduces setup friction and makes Krypton a first-class starting point in Visual Studio. ## What Changed ### 1. Added Templates Directory Structure Created a new top-level `Templates/` directory containing: - item templates - project templates - installation/readme guidance ### 2. Added Item Templates - `KryptonForm` item template - Generates a `KryptonForm` partial class and designer file. - `KryptonRibbonForm` item template - Generates a `KryptonForm` with a pre-configured `KryptonRibbon` control. ### 3. Added Project Templates - `KryptonWinFormsApp` project template - New WinForms app with `MainForm : KryptonForm`. - `KryptonRibbonWinFormsApp` project template - New WinForms app with `MainForm : KryptonForm` and a ribbon pre-added. ### 4. Standardized Template Target Framework Updated project templates to default to: - `net10.0-windows` ### 5. Added GitHub Workflow for Template Release Assets Added `.github/workflows/templates-release.yml` to: - package template folders into Visual Studio-compatible zip assets, - upload artifacts on workflow runs, - publish/update GitHub Release assets per branch channel. Branch/channel behavior: - `master` -> `templates-stable` - `canary` -> `templates-canary` - `alpha` -> `templates-alpha` - `V105-LTS` -> `templates-lts` - manual non-standard branch -> `templates-<sanitized-branch>` (prerelease) Kill switch support: - repository variable `TEMPLATES_RELEASE_DISABLED=true` ### 6. Added Comprehensive Developer Documentation Created: - `Documents/Development/Visual-Studio-Templates-Developer-Guide.md` This includes architecture, maintenance workflow, release automation details, troubleshooting, and extension guidance. Also updated: - `Templates/README.md` to include a maintainer doc link. ## Files Added/Updated (High Level) - Added: `Templates/ItemTemplates/*` - Added: `Templates/ProjectTemplates/*` - Added: `Templates/README.md` - Added: `.github/workflows/templates-release.yml` - Added: `Documents/Development/Visual-Studio-Templates-Developer-Guide.md` ## Testing Plan ### Manual Validation (Visual Studio) - [ ] Zip each template folder with `.vstemplate` at archive root. - [ ] Copy item template zips to VS ItemTemplates folder. - [ ] Copy project template zips to VS ProjectTemplates folder. - [ ] Restart Visual Studio. - [ ] Confirm templates appear in: - [ ] Add New Item (`Krypton Form`, `Krypton Ribbon Form`) - [ ] Create New Project (`Krypton WinForms App`, `Krypton Ribbon WinForms App`) - [ ] Instantiate each template and ensure files are generated correctly. - [ ] Build generated projects successfully on `net10.0-windows`. ### Workflow Validation - [ ] Run `Templates Release` via `workflow_dispatch`. - [ ] Confirm workflow artifacts include all expected zip files. - [ ] Confirm release tag/channel updated with latest assets. - [ ] Verify stable channel is latest only for `master`. ## Risks / Considerations - Visual Studio template packaging is sensitive to zip root structure; `.vstemplate` must be at archive root. - Workflow depends on GitHub release permissions (`contents: write`) and repository action variables. - `KryptonRibbonForm` is a template concept (form + ribbon setup), not a framework class with that exact type name. ## Backward Compatibility - No runtime breaking API changes in Krypton libraries. - Changes are additive (new templates + workflow + docs). ## Follow-ups (Optional) - Package templates as VSIX for one-click install. - Add CI verification that `.vstemplate` entries map to existing files. - Add screenshot examples for each template to docs/release notes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Visual Studio Templates (#908)
Summary
Implements Visual Studio item/project template support for Krypton, enabling users to create Krypton-first forms and projects directly via New Item and New Project workflows.
This addresses the feature request in #908.
Why
Previously, users typically started from standard WinForms templates and converted forms to Krypton manually. This change reduces setup friction and makes Krypton a first-class starting point in Visual Studio.
What Changed
1. Added Templates Directory Structure
Created a new top-level
Templates/directory containing:2. Added Item Templates
KryptonFormitem templateKryptonFormpartial class and designer file.KryptonRibbonFormitem templateKryptonFormwith a pre-configuredKryptonRibboncontrol.3. Added Project Templates
KryptonWinFormsAppproject templateMainForm : KryptonForm.KryptonRibbonWinFormsAppproject templateMainForm : KryptonFormand a ribbon pre-added.4. Standardized Template Target Framework
Updated project templates to default to:
net10.0-windows5. Added GitHub Workflow for Template Release Assets
Added
.github/workflows/templates-release.ymlto:Branch/channel behavior:
master->templates-stablecanary->templates-canaryalpha->templates-alphaV105-LTS->templates-ltstemplates-<sanitized-branch>(prerelease)Kill switch support:
TEMPLATES_RELEASE_DISABLED=true6. Added Comprehensive Developer Documentation
Created:
Documents/Development/Visual-Studio-Templates-Developer-Guide.mdThis includes architecture, maintenance workflow, release automation details, troubleshooting, and extension guidance.
Also updated:
Templates/README.mdto include a maintainer doc link.Files Added/Updated (High Level)
Templates/ItemTemplates/*Templates/ProjectTemplates/*Templates/README.md.github/workflows/templates-release.ymlDocuments/Development/Visual-Studio-Templates-Developer-Guide.mdTesting Plan
Manual Validation (Visual Studio)
.vstemplateat archive root.Krypton Form,Krypton Ribbon Form)Krypton WinForms App,Krypton Ribbon WinForms App)net10.0-windows.Workflow Validation
Templates Releaseviaworkflow_dispatch.master.Risks / Considerations
.vstemplatemust be at archive root.contents: write) and repository action variables.KryptonRibbonFormis a template concept (form + ribbon setup), not a framework class with that exact type name.Backward Compatibility
Follow-ups (Optional)
.vstemplateentries map to existing files.