Skip to content

feat: CPS-based XSharp project system for VS2022+ - #2052

Draft
RobertvanderHulst with Copilot wants to merge 3 commits into
mainfrom
copilot/create-new-cps-project-system
Draft

feat: CPS-based XSharp project system for VS2022+#2052
RobertvanderHulst with Copilot wants to merge 3 commits into
mainfrom
copilot/create-new-cps-project-system

Conversation

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Adds a parallel CPS (Common Project System) implementation alongside the existing MPF-based system. VS2019 continues to use MPF unchanged; VS2022/VS2026 load CPS via ProjectSystemPackage registry binding.

New: src/VisualStudio/ProjectSystem/

Core CPS wiring

  • XSharpProjectCapabilities.cs — capability constants (XSharp, Managed, MultipleTargetFrameworks, …)
  • XSharpProjectCapabilitiesProvider.cs — MEF IProjectCapabilitiesProvider export
  • XSharpProjectType.cs[ExportProjectType] binding .xsproj + GUID aa6c8d78-… to this system
  • XSharpCpsPackage.cs — async package; IsCpsEnabled defaults false, set true only after confirming VS ≥ 17.x
  • XSharpCpsPackage.pkgdefProjectSystemPackage registry entry + VO editor factory re-registrations for VS2022+

Project tree & build

  • XSharpProjectTreePropertiesProvider.cs — mirrors XSharpFileNode icon mapping (.xsfrmFormInstance, .xsmnuMainMenuControl, .prg/.xsScript, .xamlWPFFile, etc.)
  • XSharpProjectBuildProvider.csIBuildPropertiesProvider + IBuildUpToDateCheckProvider stubs
  • XSharpProjectProperties.cs — strongly-typed async wrappers for all XSharp MSBuild properties; configuration-specific reads use a proper IProjectPropertiesContext

Multi-targeting (VS2022+ only — not available in VS2019/MPF)

  • XSharpTargetFrameworkProvider.csIActiveConfiguredProjectsDimensionProvider driven by <TargetFrameworks>
  • Rules/XSharpMultiTarget.xamlTargetFrameworks / ActiveTargetFramework property rules
<!-- SDK-style .xsproj multi-targeting example (VS2022+ only) -->
<Project Sdk="XSharp.Net.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net48;net6.0-windows</TargetFrameworks>
    <Dialect>Core</Dialect>
  </PropertyGroup>
</Project>

Property pages & rules

  • Rules/XSharp.xaml — XAML MSBuild rules for Application, Build, Build Events, Debug pages
  • PropertyPages/{General,Build,Debug}PropertyPageProvider.csIPageMetadata exports wired to existing XSharpConstants page GUIDs

CodeDom / WinForms designer

  • XSharpCodeDomIntegration.cs — resolves VSXsharpCodeDomProvider from the ProjectPackage assembly at runtime via MEF; avoids a hard assembly reference

Solution

XSharp.ProjectSystem2022 added to VSIntegration2022.sln (Vs2022 folder); excluded from VSIntegration.sln (VS2019).

Copilot AI and others added 2 commits August 13, 2026 11:37
New src/VisualStudio/ProjectSystem/ folder with:
- XSharp.ProjectSystem2022.csproj (net472, CPS SDK refs)
- XSharpProjectCapabilities.cs — CPS capability constants
- XSharpProjectCapabilitiesProvider.cs — MEF export
- XSharpProjectType.cs — ExportProjectType binding .xsproj to CPS
- XSharpProjectTreePropertiesProvider.cs — file icons/tree flags
- XSharpProjectBuildProvider.cs — build-property integration + up-to-date check
- XSharpProjectProperties.cs — strongly-typed MSBuild property access
- XSharpTargetFrameworkProvider.cs — multi-targeting (VS2022+ only)
- XSharpCodeDomIntegration.cs — CodeDom bridge for WinForms
- PropertyPages/{General,Build,Debug}PropertyPageProvider.cs
- Rules/XSharp.xaml — MSBuild property rules for project designer
- Rules/XSharpMultiTarget.xaml — TargetFrameworks rule (multi-targeting)
- XSharpCpsPackage.cs — async VS package for VS2022+
- XSharpCpsPackage.pkgdef — registry entries activating CPS for .xsproj
- README.md

Also: add XSharp.ProjectSystem2022 to VSIntegration2022.sln

Co-authored-by: RobertvanderHulst <14240939+RobertvanderHulst@users.noreply.github.com>
- XSharpCpsPackage.IsCpsEnabled: default s_isCpsEnabled to false;
  only set to true after version check passes (avoids false positive
  when VS shell service is unavailable)
- XSharpProjectProperties.GetConfigurationProperties: use
  ProjectPropertiesContext to read per-configuration values instead
  of falling back to common properties
- XSharpProjectBuildProvider: remove unused stored fields for
  ConfiguredProject in both IBuildPropertiesProvider and
  IBuildUpToDateCheckProvider; add comments documenting future use

Co-authored-by: RobertvanderHulst <14240939+RobertvanderHulst@users.noreply.github.com>
Copilot AI changed the title feat: add CPS-based XSharp project system (VS2022+) feat: CPS-based XSharp project system for VS2022+ Aug 13, 2026
Co-authored-by: RobertvanderHulst <14240939+RobertvanderHulst@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants