CodeFactory.WinVs
2.26166.0.1-PreRelease
dotnet add package CodeFactory.WinVs --version 2.26166.0.1-PreRelease
NuGet\Install-Package CodeFactory.WinVs -Version 2.26166.0.1-PreRelease
<PackageReference Include="CodeFactory.WinVs" Version="2.26166.0.1-PreRelease" />
<PackageVersion Include="CodeFactory.WinVs" Version="2.26166.0.1-PreRelease" />
<PackageReference Include="CodeFactory.WinVs" />
paket add CodeFactory.WinVs --version 2.26166.0.1-PreRelease
#r "nuget: CodeFactory.WinVs, 2.26166.0.1-PreRelease"
#:package CodeFactory.WinVs@2.26166.0.1-PreRelease
#addin nuget:?package=CodeFactory.WinVs&version=2.26166.0.1-PreRelease&prerelease
#tool nuget:?package=CodeFactory.WinVs&version=2.26166.0.1-PreRelease&prerelease
CodeFactory.WinVs
The CodeFactory API for Visual Studio - Windows is the core SDK library for building CodeFactory automation that runs inside Visual Studio for Windows. It provides the full set of APIs, models, commands, and utilities needed to author automation that interacts with the Visual Studio IDE, solution, and project system.
Requirements
| Requirement | Value |
|---|---|
| Target Framework | .NET Standard 2.0 |
| Visual Studio | Visual Studio 2022 / Visual Studio 2026 (Windows) |
| CodeFactory Runtime | CodeFactory for Windows ≥ 2.26166.0.1 |
| Command Library Project | .NET Framework 4.8 |
⚠️ Important: When updating to a new version of this SDK you must recompile your automation (command library) projects and ensure the CodeFactory runtime installed in Visual Studio is at the same version or higher.
Installation
Install via the NuGet Package Manager, Package Manager Console, or the .NET CLI:
dotnet add package CodeFactory.WinVs
Or in your .csproj:
<PackageReference Include="CodeFactory.WinVs" Version="2.26166.0.1-PreRelease" />
Overview
CodeFactory.WinVs is part of the CodeFactory SDK for Visual Studio for Windows (version 2.0). It is the primary library for automation authors and provides:
- Automation Commands — Solution Explorer and IDE command hooks surfaced in Visual Studio.
- Project System Models — Strongly-typed models representing solutions, projects, folders, and source files.
- C# Code Models — A rich object model for inspecting and generating C# source code.
- External Configuration — A flexible configuration system (
ExternalConfig) for parameterizing commands without code changes. - Transaction History — Tracking of all file write operations performed by automation, including file name, project, path, character count, and line count statistics.
- Source Formatting — A
SourceFormatterAPI for generating well-formatted source code (replaces T4 templates). - Logging — Built-in structured logging via Serilog and Microsoft.Extensions.Logging abstractions.
Key Concepts
Automation Commands
Commands are the building blocks of CodeFactory automation. Two types are available:
- Solution Explorer Commands — Appear on context menus in Solution Explorer (e.g., on a project, folder, or file node).
- IDE Commands — Appear as top-level Visual Studio menu or toolbar actions.
Commands are authored in a .NET Framework 4.8 Command Library project using the CodeFactory for Windows - Command Library project template.
External Configuration (ExternalConfig)
The ExternalConfig class replaces the deprecated CommandManager for all command configuration. Configuration parameters (ConfigParameter) support the following value types:
stringboolDateTimeList
Configuration is managed through the External Configuration Editor, accessible by right-clicking the Solution node in Solution Explorer and selecting [cF] Automation Configuration.
Transaction History
CodeFactory tracks statistics for every file written by automation:
| Statistic | Description |
|---|---|
| File Name | Name of the file updated |
| Project Name | Project the file belongs to (null if solution-level) |
| Solution Name | Solution the file resides in |
| Relative Path | Path from the project or solution root |
| Characters Written | Non-whitespace, non-line-return characters written |
| Lines Written | Lines with content written |
Transaction results are returned from any insert or replace operation.
Getting Started
- Install the CodeFactory for Windows Visual Studio extension.
- Create a new CodeFactory for Windows - Command Library project (.NET Framework 4.8).
- Add this NuGet package to your command library project.
- Add a new command using the CodeFactoryWindows item templates (Add > New Item > CodeFactoryWindows).
- Implement your automation logic inside the generated command class.
- Build and package your automation using the CodeFactory.Packager.WinVs utility (called automatically on build).
Related Packages
| Package | Description |
|---|---|
CodeFactory |
Core contracts shared across all CodeFactory IDE targets (.NET Standard 2.0) |
CodeFactory.WinVs.Wpf |
WPF UI controls for Visual Studio for Windows (.NET Framework 4.8) |
📄 Release Notes
2.26166.0.1-PreRelease
Released: May 2026 — Branch: 2026-March
🆕 New
- Visual Studio 2026 support — This release targets the Visual Studio 2026 (v18.6) runtime. The CodeFactory runtime must be at version
2.26166.0.1or higher to load automation built against this SDK. - C# 13 language support — The
CodeFactorybase library now compiles withLangVersion 13. C# 13 language features are available in automation projects via the PolySharp polyfill package, which backfills required compiler attributes onto .NET Standard 2.0.
🔧 Changes
- Updated SDK version range — The supported SDK version window has been updated:
- Minimum supported SDK version:
2.24224.0.1 - Maximum supported SDK version:
2.26166.0.1
- Minimum supported SDK version:
- Copyright year updated — All library copyright notices updated to reflect 2026.
⚠️ Breaking Changes / Recompile Required
Action Required: You must recompile your automation projects against this version of the SDK before deploying to a Visual Studio 2026 environment.
Ensure the CodeFactory runtime installed in Visual Studio is at least version
2.26166.0.1.
2.23160.0.1
🐛 Fixes
- Source Manager – Add Source ordering — Fixed the roll-up order so that constructor and field positions are correctly evaluated before the top of the container when determining insertion points for Add Before and Add After operations.
🆕 New
GenerateCSharpTypeNameextension — Added a new C# generation extension onCsSourcemodels that generates the fully qualified C# type name for a target container (Class,Structure,Interface,Record).
2.23157.0.1
Initial general availability release of the CodeFactory runtime and SDK (v2.0) for Visual Studio for Windows.
- Migration of libraries from .NET Framework to .NET Standard where applicable.
- Upgraded all automation libraries to target .NET Framework 4.8.
- Integrated ADK functionality into the core runtime.
- Streamlined API call naming for improved developer experience.
- First generation of Code Blocks and Builders incorporated into the SDK and runtime.
License
This project is licensed under the MIT License.
Copyright © 2026 CodeFactory, LLC.
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- CodeFactory (>= 2.26166.0.1-PreRelease)
- MessagePack (>= 3.1.7)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- Serilog (>= 4.0.0)
- System.Collections.Immutable (>= 8.0.0)
- System.IO.Packaging (>= 7.0.0)
- System.Text.Json (>= 9.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on CodeFactory.WinVs:
| Package | Downloads |
|---|---|
|
CodeFactory.WinVs.SDK
Software development kit for building CodeFactory automation in Visual Studio - Windows. |
|
|
CodeFactory.WinVs.Wpf
Library that provides custom dialog screens hosted in Visual Studio for Windows, hosted for CodeFactory automation. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.26166.0.1-PreRelease | 116 | 6/23/2026 |
| 2.26151.0.1-PreRelease | 97 | 6/1/2026 |
| 2.25220.0.1-PreRelease | 226 | 8/8/2025 |
| 2.25165.0.1-PreRelease | 198 | 6/16/2025 |
| 2.24224.0.1-PreRelease | 188 | 8/11/2024 |
| 2.23160.1-PreRelease | 271 | 6/10/2023 |
| 2.23158.1-PreRelease | 222 | 6/7/2023 |
| 2.23157.1-PreRelease | 223 | 6/6/2023 |
| 2.23149.1-PreRelease | 216 | 5/30/2023 |
Release Updates for 2.26166.0.1
New
- **Visual Studio 2026 support** — This release targets the Visual Studio 2026 (v18.6) runtime. The CodeFactory runtime must be at version `2.26166.0.1` or higher to load automation built against this SDK.
- **C# 13 language support** — The `CodeFactory` base library now compiles with `LangVersion 13`. C# 13 language features are available in automation projects via the [PolySharp](https://github.com/Sergio0694/PolySharp) polyfill package, which backfills required compiler attributes onto .NET Standard 2.0.
Changes
- **Updated SDK version range** — The supported SDK version window has been updated:
- Minimum supported SDK version: `2.24224.0.1`
- Maximum supported SDK version: `2.26166.0.1`
- **Copyright year updated** — All library copyright notices updated to reflect 2026.
Breaking Changes / Recompile Required
> **Action Required:** You must recompile your automation projects against this version of the SDK before deploying to a Visual Studio 2026 environment.
>
> Ensure the CodeFactory runtime installed in Visual Studio is at least version `2.26166.0.1`.