Skip to content

* Create new items via 'New Item/Project'#3325

Merged
PWagner1 merged 9 commits intoalphafrom
908-feature-request-create-new-items-via-new-itemproject
Apr 27, 2026
Merged

* Create new items via 'New Item/Project'#3325
PWagner1 merged 9 commits intoalphafrom
908-feature-request-create-new-items-via-new-itemproject

Conversation

@PWagner1
Copy link
Copy Markdown
Contributor

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:

  • 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.

# 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.
@PWagner1 PWagner1 added this to the Version 110 milestone Apr 16, 2026
@PWagner1 PWagner1 requested a review from a team as a code owner April 16, 2026 07:57
@PWagner1 PWagner1 added visual studio All issues related to Visual Studio. version:110 All things to do with V110. labels Apr 16, 2026
@PWagner1 PWagner1 linked an issue Apr 16, 2026 that may be closed by this pull request
@PWagner1 PWagner1 merged commit e1244f3 into alpha Apr 27, 2026
8 checks passed
@PWagner1 PWagner1 deleted the 908-feature-request-create-new-items-via-new-itemproject branch April 27, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:110 All things to do with V110. visual studio All issues related to Visual Studio.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Create new items via ' New Item/Project '

1 participant