-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: main
Are you sure you want to change the base?
Conversation
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 was a problem hiding this 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 inGenerateBundledVersions.targets
and useDepRuntimeCommit
for its commit. - Update bundled templates for WinForms and WPF to use
MicrosoftNETSdkWindowsDesktopPackageVersion
. - Remove WindowsDesktop/WPF/WinForms version entries from
Versions.props
andVersion.Details.xml
, and map their props inDirectory.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'" />
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> |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
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>
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.