Skip to content

Commit c2d6594

Browse files
authored
[release/7.0] Fix pinned assembly version 7.0 (#84355)
* 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 0506145 commit c2d6594

File tree

20 files changed

+76
-33
lines changed

20 files changed

+76
-33
lines changed

eng/packaging.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<_IsWindowsDesktopApp Condition="$(WindowsDesktopCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsWindowsDesktopApp>
4444
<_IsAspNetCoreApp Condition="$(AspNetCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsAspNetCoreApp>
4545
<_AssemblyInTargetingPack Condition="('$(IsNETCoreAppSrc)' == 'true' or '$(IsNetCoreAppRef)' == 'true' or '$(_IsAspNetCoreApp)' == 'true' or '$(_IsWindowsDesktopApp)' == 'true') and '$(TargetFrameworkIdentifier)' != '.NETFramework'">true</_AssemblyInTargetingPack>
46-
<!-- Assembly version do not get updated in non-netfx ref pack assemblies. -->
46+
<!-- The assembly version gets updated when the assembly isn't part of a targeting pack. -->
4747
<AssemblyVersion Condition="'$(_AssemblyInTargetingPack)' != 'true'">$(MajorVersion).$(MinorVersion).0.$(ServicingVersion)</AssemblyVersion>
4848
</PropertyGroup>
4949

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<!-- Reference the outputs for the dependency nodes calculation. -->
66
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
77
<IsPackable>true</IsPackable>
8-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
9-
<ServicingVersion>1</ServicingVersion>
8+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9+
<ServicingVersion>2</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 as well as .NET Standard.</PackageDescription>
Lines changed: 0 additions & 1 deletion
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>
Lines changed: 8 additions & 0 deletions
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

Lines changed: 0 additions & 4 deletions
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>
Lines changed: 8 additions & 0 deletions
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

Lines changed: 0 additions & 4 deletions
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>
Lines changed: 10 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<IncludeDllSafeSearchPathAttribute>true</IncludeDllSafeSearchPathAttribute>
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>0</ServicingVersion>
8+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9+
<ServicingVersion>1</ServicingVersion>
1010
<Nullable>annotations</Nullable>
1111
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
1212
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>

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

Lines changed: 0 additions & 4 deletions
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>

0 commit comments

Comments
 (0)