Skip to content

Eliminate windowsdesktop, wpf, and winforms version elements #49722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mmitche
Copy link
Member

@mmitche mmitche commented Jul 9, 2025

There are a few cases where WindowsDesktop info makes it into the SDK. Binaries on Windows, but also bundled version information on all platforms. But in the VMR, the Linux and Mac verticals cannot build windowsdesktop, wpf, or winforms. This means that these properties end up with the N-1 (or last backflow) version. That leads to product issues where you can't target windowsdesktop on Linux or Mac. These bugs are subtle.

Luckily, we can avoid a pretty horrible join point by relying on the fact that the version numbers for all the shared frameworks (and internal non-shipping versions) align across the core runtime runtime repos for all the version numbers in question. Use the runtime versions instead of windowsdesktop, wpf, and winforms versions. To avoid accidental, I've eliminated these dependencies from Version.Details.xml, and set the original properties based on runtime properties that we know build every time.

There are a few cases where WindowsDesktop info makes it into the SDK. Binaries on Windows, but also bundled version information on all platforms. But in the VMR, the Linux and Mac verticals cannot build windowsdesktop, wpf, or winforms. This means that these properties end up with the N-1 (or last backflow) version. That leads to product issues where you can't target windowsdesktop on Linux or Mac. These bugs are subtle.

Luckily, we can avoid a pretty horrible join point by relying on the fact that the version numbers for all the shared frameworks (and internal non-shipping versions) align across the core runtime runtime repos for all the version numbers in question. Use the runtime versions instead of windowsdesktop, wpf, and winforms versions. To avoid accidental, I've eliminated these dependencies from Version.Details.xml, and set the original properties based on runtime properties that we know build every time.
@mmitche mmitche requested review from Copilot and a team July 9, 2025 22:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes explicit WindowsDesktop, WPF, and WinForms version dependencies and instead aligns those versions with the core runtime shared framework properties, ensuring consistency across platforms and avoiding Windows-only build leaks.

  • Eliminate GetDependencyInfo for WindowsDesktop in GenerateBundledVersions.targets and use DepRuntimeCommit for its commit.
  • Update bundled templates for WinForms and WPF to use MicrosoftNETSdkWindowsDesktopPackageVersion.
  • Remove WindowsDesktop/WPF/WinForms version entries from Versions.props and Version.Details.xml, and map their props in Directory.Build.props to runtime-based properties.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
GenerateBundledVersions.targets Dropped WindowsDesktop dependency info and switched commit to use runtime commit.
BundledTemplates.targets Changed WinForms/WPF template package versions to use SDK WindowsDesktop property.
eng/Versions.props Removed separate WinForms, WPF, and WindowsDesktop version properties.
eng/Version.Details.xml Removed WindowsDesktop, WinForms, and WPF dependency entries.
Directory.Build.props Added mappings for WindowsDesktop properties to use runtime/ref/sdk versions.
Comments suppressed due to low confidence (2)

Directory.Build.props:99

  • [nitpick] The comment could clarify which runtime property (e.g., MicrosoftNETCorePlatformsPackageVersion) feeds each WindowsDesktop mapping; consider listing the mapping sources for readers.
    <!-- These are set based on the runtime shared framework and internal versions. This is because windowsdesktop is not built in

src/Layout/redist/targets/BundledTemplates.targets:6

  • [nitpick] Verify that using a single MicrosoftNETSdkWindowsDesktopPackageVersion for both WinForms and WPF templates will always match their actual package versions; consider pulling from individual template version properties if they diverge in future.
    <Bundled100Templates Include="Microsoft.Dotnet.WinForms.ProjectTemplates" PackageVersion="$(MicrosoftNETSdkWindowsDesktopPackageVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />

@mmitche
Copy link
Member Author

mmitche commented Jul 9, 2025

I was pretty torn on how far to go with this. You could just rip out all shared framework versions and replace them with a single property. Workable? Sure...Nice and clean? No...

<MicrosoftWindowsDesktopAppRuntimePackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftWindowsDesktopAppRuntimePackageVersion>
<MicrosoftWindowsDesktopAppRefPackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftWindowsDesktopAppRefPackageVersion>
<MicrosoftNETSdkWindowsDesktopPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</MicrosoftNETSdkWindowsDesktopPackageVersion>
<MicrosoftWindowsDesktopAppInternalPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</MicrosoftWindowsDesktopAppInternalPackageVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why the last two use MicrosoftNETCorePlatformsPackageVersion instead of MicrosoftNETCoreAppRefPackageVersion ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NETCorePlatforms is non-stable, while the ref pack stabilizes

mmitche and others added 3 commits July 10, 2025 08:52
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.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