Skip to content

Commit b9ab83e

Browse files
authored
Don't redistribute inbox msbuild dependencies (#10722)
* Don't redistribute inbox msbuild dependencies Fixes #10721 Also use the "Toolset" version prefix that is also used in dotnet/runtime and dotnet/sdk. * Improvements * Use SRM toolset version on .NETFramework * Fix typo
1 parent abdd599 commit b9ab83e

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

eng/Versions.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
<SystemSecurityPermissionsPackageVersion>10.0.0-preview.4.25205.3</SystemSecurityPermissionsPackageVersion>
4646
<SystemWindowsExtensionsPackageVersion>10.0.0-preview.4.25205.3</SystemWindowsExtensionsPackageVersion>
4747
</PropertyGroup>
48+
<!-- These are minimum versions used for netfx-targeted components that run in Visual Studio because in those cases,
49+
Visual Studio is providing those assemblies, and we should work with whichever version it ships. -->
50+
<PropertyGroup>
51+
<SystemReflectionMetadataLoadContextToolsetVersion>8.0.0</SystemReflectionMetadataLoadContextToolsetVersion>
52+
</PropertyGroup>
4853
<!-- Docs / Intellisense -->
4954
<PropertyGroup>
5055
<MicrosoftPrivateIntellisenseVersion>9.0.0-preview-20241010.1</MicrosoftPrivateIntellisenseVersion>
@@ -58,11 +63,6 @@
5863
<MicrosoftSourceLinkGitHubVersion>8.0.0-beta.23409.2</MicrosoftSourceLinkGitHubVersion>
5964
<MicrosoftSourceLinkAzureReposGitVersion>8.0.0-beta.23409.2</MicrosoftSourceLinkAzureReposGitVersion>
6065
</PropertyGroup>
61-
<!-- Maintain System.CodeDom PackageVersion at 4.4.0. See https://github.com/Microsoft/msbuild/issues/3627 -->
62-
<!-- Pin specific versions of S.Memory so that it would supply AssemblyVersion=4.0.1.0. See https://github.com/dotnet/runtime/issues/31672 -->
63-
<PropertyGroup>
64-
<SystemCodeDomPackageVersionForPresentationBuildTasks>4.5.0</SystemCodeDomPackageVersionForPresentationBuildTasks>
65-
</PropertyGroup>
6666
<!-- Other Packages that require manual updating-->
6767
<PropertyGroup>
6868
<MicrosoftBuildFrameworkPackageVersion>15.9.20</MicrosoftBuildFrameworkPackageVersion>

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/PresentationBuildTasks.csproj

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,9 @@
4747
<PackagingContent Include="$(MSBuildThisFileDirectory)Microsoft.WinFX.targets" SubFolder="root\targets" />
4848
</ItemGroup>
4949

50-
<!--
51-
Limit the assemblies that are packaged into Microsoft.NET.Sdk.WindowsDesktop
52-
-->
53-
<ItemGroup Condition="'$(TargetFramework)'=='net472'">
54-
<PackagingAssemblyContent Include="System.Collections.Immutable.dll" />
55-
<PackagingAssemblyContent Include="System.Memory.dll" />
56-
<PackagingAssemblyContent Include="System.Numerics.Vectors.dll" />
57-
<PackagingAssemblyContent Include="System.Reflection.Metadata.dll" />
58-
<PackagingAssemblyContent Include="System.Runtime.CompilerServices.Unsafe.dll" />
59-
</ItemGroup>
50+
<!-- Limit the assemblies that are packaged into Microsoft.NET.Sdk.WindowsDesktop -->
6051
<ItemGroup>
6152
<PackagingAssemblyContent Include="PresentationBuildTasks.dll" />
62-
<PackagingAssemblyContent Include="System.Reflection.MetadataLoadContext.dll" />
6353
</ItemGroup>
6454

6555
<ItemGroup>
@@ -308,14 +298,16 @@
308298
</ItemGroup>
309299

310300
<ItemGroup>
311-
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
312-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" />
313-
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="$(SystemReflectionMetadataLoadContextVersion)" />
301+
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" IncludeAssets="compile" />
302+
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" IncludeAssets="compile" />
314303

315-
<!--
316-
Provide specific/old versions for PresentationBuildTasks which needs to run inside MSBuild
317-
-->
318-
<PackageReference Include="System.CodeDom" Version="$(SystemCodeDomPackageVersionForPresentationBuildTasks)" />
304+
<!-- Reference (don't redistribute) the live version of SRM on .NETCoreApp and fallback to the toolset version for .NET Framework. -->
305+
<PackageReference Include="System.Reflection.MetadataLoadContext" IncludeAssets="compile">
306+
<Version Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">$(SystemReflectionMetadataLoadContextVersion)</Version>
307+
<Version Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">$(SystemReflectionMetadataLoadContextToolsetVersion)</Version>
308+
</PackageReference>
309+
<!-- System.CodeDom live version is provided by the SDK. Use latest and don't redistribute it. -->
310+
<PackageReference Include="System.CodeDom" Version="$(SystemCodeDomPackageVersion)" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" IncludeAssets="compile" />
319311
</ItemGroup>
320312

321313
</Project>

0 commit comments

Comments
 (0)