Skip to content

Commit 3c935ba

Browse files
authored
[release/6.0] Fix pinned assembly version 6.0 (#84357)
* Eight packable projects pin their assembly version for .NET Framework compatibility. The incremental package servicing infrastructure didn't check if the assembly version is pinned and changed it during servicing. As an example, System.Speech pins its assembly version to 4.0.0.0 but that version gets overwritten during servicing. I.e. for .NET 7 the version would then change to "7.0.0.$(ServicingVersion)" which is incorrect. Please find the full list of impacted assemblies below: - System.ComponentModel.Composition - System.DirectoryServices - System.DirectoryServices.AccountManagement - System.DirectoryServices.Protocols - System.Management - System.Reflection.Context - System.Runtime.Caching - System.Speech For System.DirectoryServices.Protocols and System.Management we'll only pin the version for the .NETStandard assembly since those previously shipped the newer versions in servicing. * Enable System.Management and System.DirectoryServices.Protocols in servicing * Address feedback
1 parent d619619 commit 3c935ba

20 files changed

+74
-31
lines changed

eng/packaging.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<_IsWindowsDesktopApp Condition="$(WindowsDesktopCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsWindowsDesktopApp>
5252
<_IsAspNetCoreApp Condition="$(AspNetCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsAspNetCoreApp>
5353
<_AssemblyInTargetingPack Condition="('$(IsNETCoreAppSrc)' == 'true' or '$(IsNetCoreAppRef)' == 'true' or '$(_IsAspNetCoreApp)' == 'true' or '$(_IsWindowsDesktopApp)' == 'true') and '$(TargetFrameworkIdentifier)' != '.NETFramework'">true</_AssemblyInTargetingPack>
54-
<!-- Assembly version do not get updated in non-netfx ref pack assemblies. -->
54+
<!-- The assembly version gets updated when the assembly isn't part of a targeting pack. -->
5555
<AssemblyVersion Condition="'$(_AssemblyInTargetingPack)' != 'true'">$(MajorVersion).$(MinorVersion).0.$(ServicingVersion)</AssemblyVersion>
5656
</PropertyGroup>
5757

src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
77
<IsPackable>true</IsPackable>
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9-
<ServicingVersion>4</ServicingVersion>
9+
<ServicingVersion>5</ServicingVersion>
1010
<!-- This is a meta package and doesn't contain any libs. -->
1111
<NoWarn>$(NoWarn);NU5128</NoWarn>
1212
<PackageDescription>This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.</PackageDescription>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
4-
<AssemblyVersion>4.0.0.0</AssemblyVersion>
54
<StrongNameKeyId>ECMA</StrongNameKeyId>
65
</PropertyGroup>
76
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
<PropertyGroup>
4+
<!-- This assembly is inbox in .NETFramework, ensure that the AssemblyVersion
5+
remains <= the .NETFramework version -->
6+
<AssemblyVersion>4.0.0.0</AssemblyVersion>
7+
</PropertyGroup>
8+
</Project>

src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
4-
<!-- this assembly is inbox in desktop, do not version it unless you
5-
plan on shipping a new desktop version out of band. Instead add API
6-
to a different assembly. -->
7-
<AssemblyVersion>4.0.0.0</AssemblyVersion>
84
<StrongNameKeyId>ECMA</StrongNameKeyId>
95
<SupportedOSPlatforms>windows</SupportedOSPlatforms>
106
</PropertyGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
<PropertyGroup>
4+
<!-- This assembly is inbox in .NETFramework, ensure that the AssemblyVersion
5+
remains <= the .NETFramework version -->
6+
<AssemblyVersion>4.0.0.0</AssemblyVersion>
7+
</PropertyGroup>
8+
</Project>

src/libraries/System.DirectoryServices.Protocols/Directory.Build.props

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
4-
<!-- this assembly is inbox in desktop, do not version it unless you
5-
plan on shipping a new desktop version out of band. Instead add API
6-
to a different assembly. -->
7-
<AssemblyVersion>4.0.0.0</AssemblyVersion>
84
<StrongNameKeyId>Microsoft</StrongNameKeyId>
95
<IncludePlatformAttributes>true</IncludePlatformAttributes>
106
<UnsupportedOSPlatforms>browser;android;ios;tvos</UnsupportedOSPlatforms>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
<PropertyGroup>
4+
<!-- This assembly is inbox in .NETFramework, ensure that the .NETStandard assembly
5+
remains <= the .NETFramework version.
6+
Allow non-NETStandard assemblies to version to be compatible with past serviced packages which
7+
shipped higher versions. -->
8+
<AssemblyVersion Condition="'$(TargetFramework)' == 'netstandard2.0'">4.0.0.0</AssemblyVersion>
9+
</PropertyGroup>
10+
</Project>

src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1-OSX;netcoreapp3.1-Linux;netcoreapp3.1;netstandard2.0</TargetFrameworks>
66
<IsPackable>true</IsPackable>
77
<!-- If you enable GeneratePackageOnBuild for this package and bump ServicingVersion, make sure to also bump ServicingVersion in Microsoft.Windows.Compatibility.csproj once for the next release. -->
8-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
9-
<ServicingVersion>1</ServicingVersion>
8+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9+
<ServicingVersion>2</ServicingVersion>
1010
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
1111
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
1212
<PackageDescription>Provides the methods defined in the Lightweight Directory Access Protocol (LDAP) version 3 (V3) and Directory Services Markup Language (DSML) version 2.0 (V2) standards.</PackageDescription>

src/libraries/System.DirectoryServices/Directory.Build.props

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
4-
<!-- this assembly is inbox in desktop, do not version it unless you
5-
plan on shipping a new desktop version out of band. Instead add API
6-
to a different assembly. -->
7-
<AssemblyVersion>4.0.0.0</AssemblyVersion>
84
<!-- Since this assembly version is pinned, we don't want to validate that it matches
95
the expected assembly version on the targeting pack. -->
106
<SkipValidateAssemblyVersion>true</SkipValidateAssemblyVersion>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
<PropertyGroup>
4+
<!-- This assembly is inbox in .NETFramework, ensure that the AssemblyVersion
5+
remains <= the .NETFramework version -->
6+
<AssemblyVersion>4.0.0.0</AssemblyVersion>
7+
</PropertyGroup>
8+
</Project>

src/libraries/System.Management/Directory.Build.props

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
4-
<!-- this assembly is inbox in desktop, do not version it unless you
5-
plan on shipping a new desktop version out of band. Instead add API
6-
to a different assembly. -->
7-
<AssemblyVersion>4.0.0.0</AssemblyVersion>
84
<StrongNameKeyId>Microsoft</StrongNameKeyId>
95
<SupportedOSPlatforms>windows</SupportedOSPlatforms>
106
</PropertyGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
<PropertyGroup>
4+
<!-- This assembly is inbox in .NETFramework, ensure that the .NETStandard assembly
5+
remains <= the .NETFramework version.
6+
Allow non-NETStandard assemblies to version to be compatible with past serviced packages which
7+
shipped higher versions. -->
8+
<AssemblyVersion Condition="'$(TargetFramework)' == 'netstandard2.0'">4.0.0.0</AssemblyVersion>
9+
</PropertyGroup>
10+
</Project>

src/libraries/System.Management/src/System.Management.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<IsPackable>true</IsPackable>
88
<!-- If you enable GeneratePackageOnBuild for this package and bump ServicingVersion, make sure to also bump ServicingVersion in Microsoft.Windows.Compatibility.csproj once for the next release. -->
99
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
10-
<ServicingVersion>1</ServicingVersion>
10+
<ServicingVersion>2</ServicingVersion>
1111
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
1212
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
1313
<PackageDescription>Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
4-
<AssemblyVersion>4.0.3.0</AssemblyVersion>
54
<StrongNameKeyId>ECMA</StrongNameKeyId>
65
</PropertyGroup>
76
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
<PropertyGroup>
4+
<!-- This assembly is inbox in .NETFramework, ensure that the AssemblyVersion
5+
remains <= the .NETFramework version.
6+
4.0.3.0 breaks this causing https://github.com/dotnet/runtime/issues/84320 -->
7+
<AssemblyVersion>4.0.3.0</AssemblyVersion>
8+
</PropertyGroup>
9+
</Project>

src/libraries/System.Runtime.Caching/Directory.Build.props

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
4-
<!-- this assembly is inbox in desktop, do not version it unless you
5-
plan on shipping a new desktop version out of band. Instead add API
6-
to a different assembly. -->
7-
<AssemblyVersion>4.0.0.0</AssemblyVersion>
84
<StrongNameKeyId>Microsoft</StrongNameKeyId>
95
<IncludePlatformAttributes>true</IncludePlatformAttributes>
106
</PropertyGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
<PropertyGroup>
4+
<!-- This assembly is inbox in .NETFramework, ensure that the AssemblyVersion
5+
remains <= the .NETFramework version -->
6+
<AssemblyVersion>4.0.0.0</AssemblyVersion>
7+
</PropertyGroup>
8+
</Project>

src/libraries/System.Speech/Directory.Build.props

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
4-
<!-- this assembly is inbox in desktop, do not version it unless you
5-
plan on shipping a new desktop version out of band. Instead add API
6-
to a different assembly. -->
7-
<AssemblyVersion>4.0.0.0</AssemblyVersion>
84
<StrongNameKeyId>MicrosoftShared</StrongNameKeyId>
95
<SupportedOSPlatforms>windows</SupportedOSPlatforms>
106
</PropertyGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.targets" />
3+
<PropertyGroup>
4+
<!-- This assembly is inbox in .NETFramework, ensure that the AssemblyVersion
5+
remains <= the .NETFramework version -->
6+
<AssemblyVersion>4.0.0.0</AssemblyVersion>
7+
</PropertyGroup>
8+
</Project>

0 commit comments

Comments
 (0)