Skip to content

Commit 8e339a2

Browse files
committed
Eliminate windowsdesktop, wpf, and winforms version elements
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.
1 parent c92496c commit 8e339a2

File tree

5 files changed

+14
-49
lines changed

5 files changed

+14
-49
lines changed

Directory.Build.props

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@
9696
<MicrosoftNETCoreAppHostPackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftNETCoreAppHostPackageVersion>
9797
<MicrosoftNETCoreAppRuntimePackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftNETCoreAppRuntimePackageVersion>
9898
<MicrosoftAspNetCoreAppRuntimePackageVersion>$(MicrosoftAspNetCoreAppRefPackageVersion)</MicrosoftAspNetCoreAppRuntimePackageVersion>
99-
<MicrosoftWindowsDesktopAppRuntimePackageVersion>$(MicrosoftWindowsDesktopAppRefPackageVersion)</MicrosoftWindowsDesktopAppRuntimePackageVersion>
99+
<!-- These are set based on the runtime shared framework and internal versions. This is because windowsdesktop is not built in
100+
all VMR builds, but its version numbers are used to generate various bits of information. The VMR always aligns the version
101+
numbers of the shared frameworks. -->
102+
<MicrosoftWindowsDesktopAppRuntimePackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftWindowsDesktopAppRuntimePackageVersion>
103+
<MicrosoftWindowsDesktopAppRefPackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftWindowsDesktopAppRefPackageVersion>
104+
<MicrosoftNETSdkWindowsDesktopPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</MicrosoftNETSdkWindowsDesktopPackageVersion>
105+
<MicrosoftWindowsDesktopAppInternalPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</MicrosoftWindowsDesktopAppInternalPackageVersion>
100106

101107
<HostFxrVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</HostFxrVersion>
102108
<SharedHostVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</SharedHostVersion>

eng/Version.Details.xml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -225,18 +225,6 @@
225225
<Uri>https://github.com/dotnet/dotnet</Uri>
226226
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
227227
</Dependency>
228-
<Dependency Name="Microsoft.WindowsDesktop.App.Ref" Version="10.0.0-preview.7.25351.106">
229-
<Uri>https://github.com/dotnet/dotnet</Uri>
230-
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
231-
</Dependency>
232-
<Dependency Name="Microsoft.WindowsDesktop.App.Internal" Version="10.0.0-preview.7.25351.106">
233-
<Uri>https://github.com/dotnet/dotnet</Uri>
234-
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
235-
</Dependency>
236-
<Dependency Name="Microsoft.NET.Sdk.WindowsDesktop" Version="10.0.0-preview.7.25351.106">
237-
<Uri>https://github.com/dotnet/dotnet</Uri>
238-
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
239-
</Dependency>
240228
<Dependency Name="Microsoft.AspNetCore.App.Ref" Version="10.0.0-preview.7.25351.106">
241229
<Uri>https://github.com/dotnet/dotnet</Uri>
242230
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
@@ -362,15 +350,6 @@
362350
<Uri>https://github.com/dotnet/dotnet</Uri>
363351
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
364352
</Dependency>
365-
<!-- For coherency purposes, these versions should be gated by the versions of winforms and wpf routed via windowsdesktop -->
366-
<Dependency Name="Microsoft.Dotnet.WinForms.ProjectTemplates" Version="10.0.0-preview.7.25351.106">
367-
<Uri>https://github.com/dotnet/dotnet</Uri>
368-
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
369-
</Dependency>
370-
<Dependency Name="Microsoft.DotNet.Wpf.ProjectTemplates" Version="10.0.0-preview.7.25351.106">
371-
<Uri>https://github.com/dotnet/dotnet</Uri>
372-
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>
373-
</Dependency>
374353
<Dependency Name="Microsoft.Web.Xdt" Version="10.0.0-preview.25351.106">
375354
<Uri>https://github.com/dotnet/dotnet</Uri>
376355
<Sha>eaa19c281d34580a8168cff9ce1e7337da8bfe4f</Sha>

eng/Versions.props

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@
9595
<!-- Dependency from https://github.com/dotnet/aspire -->
9696
<AspirePackageVersion>9.1.0-preview.1.24555.3</AspirePackageVersion>
9797
</PropertyGroup>
98-
<PropertyGroup>
99-
<!-- Dependency from https://github.com/dotnet/winforms -->
100-
<MicrosoftDotnetWinFormsProjectTemplatesPackageVersion>10.0.0-preview.7.25351.106</MicrosoftDotnetWinFormsProjectTemplatesPackageVersion>
101-
</PropertyGroup>
10298
<PropertyGroup>
10399
<!-- Dependencies from https://github.com/dotnet/runtime -->
104100
<MicrosoftNETCoreAppRefPackageVersion>10.0.0-preview.7.25351.106</MicrosoftNETCoreAppRefPackageVersion>
@@ -148,11 +144,6 @@
148144
<SystemThreadingTasksExtensionsToolsetPackageVersion>4.5.4</SystemThreadingTasksExtensionsToolsetPackageVersion>
149145
<SystemResourcesExtensionsToolsetPackageVersion>8.0.0</SystemResourcesExtensionsToolsetPackageVersion>
150146
</PropertyGroup>
151-
<PropertyGroup>
152-
<!-- Dependencies from https://github.com/dotnet/windowsdesktop -->
153-
<MicrosoftWindowsDesktopAppInternalPackageVersion>10.0.0-preview.7.25351.106</MicrosoftWindowsDesktopAppInternalPackageVersion>
154-
<MicrosoftWindowsDesktopAppRefPackageVersion>10.0.0-preview.7.25351.106</MicrosoftWindowsDesktopAppRefPackageVersion>
155-
</PropertyGroup>
156147
<PropertyGroup>
157148
<!-- Dependencies from https://github.com/nuget/nuget.client -->
158149
<NuGetBuildTasksPackageVersion>7.0.0-preview.1.20</NuGetBuildTasksPackageVersion>
@@ -241,7 +232,6 @@
241232
<MicrosoftAspNetCoreMvcApiAnalyzersPackageVersion>10.0.0-preview.7.25351.106</MicrosoftAspNetCoreMvcApiAnalyzersPackageVersion>
242233
<MicrosoftAspNetCoreAnalyzersPackageVersion>10.0.0-preview.7.25351.106</MicrosoftAspNetCoreAnalyzersPackageVersion>
243234
<MicrosoftAspNetCoreTestHostPackageVersion>10.0.0-preview.7.25351.106</MicrosoftAspNetCoreTestHostPackageVersion>
244-
<MicrosoftAspNetCoreAppRuntimewinx64PackageVersion>10.0.0-preview.5.25265.101</MicrosoftAspNetCoreAppRuntimewinx64PackageVersion>
245235
<MicrosoftAspNetCoreAppRefInternalPackageVersion>10.0.0-preview.7.25351.106</MicrosoftAspNetCoreAppRefInternalPackageVersion>
246236
<MicrosoftAspNetCoreAuthenticationFacebookVersion>10.0.0-preview.7.25351.106</MicrosoftAspNetCoreAuthenticationFacebookVersion>
247237
<MicrosoftAspNetCoreAuthenticationGoogleVersion>10.0.0-preview.7.25351.106</MicrosoftAspNetCoreAuthenticationGoogleVersion>
@@ -260,7 +250,6 @@
260250
<MicrosoftExtensionsFileProvidersEmbeddedVersion>10.0.0-preview.7.25351.106</MicrosoftExtensionsFileProvidersEmbeddedVersion>
261251
<MicrosoftDotNetWebItemTemplates100PackageVersion>10.0.0-preview.7.25351.106</MicrosoftDotNetWebItemTemplates100PackageVersion>
262252
<MicrosoftDotNetWebProjectTemplates100PackageVersion>10.0.0-preview.7.25351.106</MicrosoftDotNetWebProjectTemplates100PackageVersion>
263-
<VSRedistCommonAspNetCoreSharedFrameworkx64100PackageVersion>10.0.0-preview.5.25265.101</VSRedistCommonAspNetCoreSharedFrameworkx64100PackageVersion>
264253
<dotnetdevcertsPackageVersion>10.0.0-preview.7.25351.106</dotnetdevcertsPackageVersion>
265254
<dotnetuserjwtsPackageVersion>10.0.0-preview.7.25351.106</dotnetuserjwtsPackageVersion>
266255
<dotnetusersecretsPackageVersion>10.0.0-preview.7.25351.106</dotnetusersecretsPackageVersion>
@@ -282,11 +271,6 @@
282271
<EmscriptenVersionNet7>3.1.12</EmscriptenVersionNet7>
283272
<EmscriptenVersionNet6>2.0.23</EmscriptenVersionNet6>
284273
</PropertyGroup>
285-
<PropertyGroup>
286-
<!-- Dependencies from https://github.com/dotnet/wpf -->
287-
<MicrosoftNETSdkWindowsDesktopPackageVersion>10.0.0-preview.7.25351.106</MicrosoftNETSdkWindowsDesktopPackageVersion>
288-
<MicrosoftDotNetWpfProjectTemplatesPackageVersion>10.0.0-preview.7.25351.106</MicrosoftDotNetWpfProjectTemplatesPackageVersion>
289-
</PropertyGroup>
290274
<PropertyGroup Label="Infrastructure and test only dependencies">
291275
<VersionToolsVersion>2.2.0-beta.19072.10</VersionToolsVersion>
292276
<MicrosoftDotNetScenarioTestsSdkTemplateTestsVersion>10.0.0-preview.24602.1</MicrosoftDotNetScenarioTestsSdkTemplateTestsVersion>

src/Layout/redist/targets/BundledTemplates.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<ItemGroup Label=".NET 10.0 templates">
44
<Bundled100Templates Include="Microsoft.DotNet.Web.ItemTemplates.10.0" PackageVersion="$(MicrosoftDotNetWebItemTemplates100PackageVersion)" />
55
<Bundled100Templates Include="Microsoft.DotNet.Web.ProjectTemplates.10.0" PackageVersion="$(MicrosoftDotNetWebProjectTemplates100PackageVersion)" UseVersionForTemplateInstallPath="true" />
6-
<Bundled100Templates Include="Microsoft.Dotnet.WinForms.ProjectTemplates" PackageVersion="$(MicrosoftDotNetWinFormsProjectTemplatesPackageVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
7-
<Bundled100Templates Include="Microsoft.Dotnet.Wpf.ProjectTemplates" PackageVersion="$(MicrosoftDotNetWpfProjectTemplatesPackageVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
6+
<Bundled100Templates Include="Microsoft.Dotnet.WinForms.ProjectTemplates" PackageVersion="$(MicrosoftNETSdkWindowsDesktopPackageVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
7+
<Bundled100Templates Include="Microsoft.Dotnet.Wpf.ProjectTemplates" PackageVersion="$(MicrosoftNETSdkWindowsDesktopPackageVersion)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
88
</ItemGroup>
99

1010
<ItemGroup>

src/Layout/redist/targets/GenerateBundledVersions.targets

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,14 @@
3232
<Output TaskParameter="DependencyCommit" PropertyName="DepAspNetCoreCommit" />
3333
</GetDependencyInfo>
3434

35-
<GetDependencyInfo
36-
VersionDetailsXmlFile="$(RepositoryEngineeringDir)Version.Details.xml"
37-
DependencyName="Microsoft.WindowsDesktop.App.Ref"
38-
Condition="'$(DotNetBuildFromVMR)' != 'true'">
39-
<Output TaskParameter="DependencyVersion" PropertyName="DepWindowsDesktopVersion" />
40-
<Output TaskParameter="DependencyCommit" PropertyName="DepWindowsDesktopCommit" />
41-
</GetDependencyInfo>
42-
4335
<ItemGroup Label="Version info">
4436
<Line Include="runtime" Version="$(MicrosoftNETCoreAppRefPackageVersion)" Commit="$([MSBuild]::ValueOrDefault('$(DepRuntimeCommit)', '$(BUILD_SOURCEVERSION)'))" />
4537
<Line Include="aspnetcore" Version="$(MicrosoftAspNetCoreAppRefPackageVersion)" Commit="$([MSBuild]::ValueOrDefault('$(DepAspNetCoreCommit)', '$(BUILD_SOURCEVERSION)'))" />
46-
<Line Include="windowsdesktop" Version="$(MicrosoftWindowsDesktopAppRefPackageVersion)" Commit="$([MSBuild]::ValueOrDefault('$(DepWindowsDesktopCommit)', '$(BUILD_SOURCEVERSION)'))" />
38+
<!-- For the windows desktop commit, use the Microsoft.NETCore.App.Ref commit.
39+
These will always be the same and the Microsoft.NETCore.App.Ref dependency has been eliminated from Version.Details.xml
40+
so the property cannot be used in VMR builds. It should not be used in VMR builds because Linux/Mac do not build it, though
41+
info about WindowsDesktop **does** leak into those SDKs. -->
42+
<Line Include="windowsdesktop" Version="$(MicrosoftWindowsDesktopAppRefPackageVersion)" Commit="$([MSBuild]::ValueOrDefault('$(DepRuntimeCommit)', '$(BUILD_SOURCEVERSION)'))" />
4743
<Line Include="sdk" Version="$(PackageVersion)" Commit="$(BUILD_SOURCEVERSION)" />
4844
</ItemGroup>
4945

0 commit comments

Comments
 (0)