Skip to content

Commit 2f666ec

Browse files
ericstjCopilot
andauthored
Account for framework packages that have been removed (#49882)
Co-authored-by: Copilot <[email protected]>
1 parent d3d494e commit 2f666ec

File tree

6 files changed

+38
-4
lines changed

6 files changed

+38
-4
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,15 @@ public static FrameworkPackages LoadFrameworkPackagesFromPack(Logger log, NuGetF
167167

168168
private void Add(string id, string version)
169169
{
170-
// intentionally redirect to indexer to allow for overwrite
171-
this.Packages[id] = NuGetVersion.Parse(version);
170+
if (string.IsNullOrEmpty(version))
171+
{
172+
this.Packages.Remove(id);
173+
}
174+
else
175+
{
176+
// intentionally redirect to indexer to allow for overwrite
177+
this.Packages[id] = NuGetVersion.Parse(version);
178+
}
172179
}
173180

174181
public bool IsAFrameworkComponent(string id, NuGetVersion version) => this.Packages.TryGetValue(id, out var frameworkPackageVersion) && frameworkPackageVersion >= version;

src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net5.0.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ internal static class NETCoreApp50
3131
{ "System.Text.Json", "5.0.0" },
3232
{ "System.Threading.Channels", "5.0.0" },
3333
{ "System.Threading.Tasks.Dataflow", "5.0.0" },
34+
// removed packages
35+
{ "System.Runtime.InteropServices.WindowsRuntime", null },
36+
{ "System.Runtime.WindowsRuntime", null },
37+
{ "System.Runtime.WindowsRuntime.UI.Xaml", null },
3438
};
3539

3640
internal static FrameworkPackages AspNetCore { get; } = new(Net50, FrameworkNames.AspNetCoreApp, NETCoreApp31.AspNetCore)
@@ -169,6 +173,9 @@ internal static class NETCoreApp50
169173
{ "System.Security.Permissions", "5.0.0" },
170174
{ "System.Security.Principal.Windows", "5.0.0" },
171175
{ "System.Windows.Extensions", "5.0.0" },
176+
// removed packages
177+
{ "Microsoft.Win32.SystemEvents", null },
178+
{ "System.Drawing.Common", null },
172179
};
173180

174181
internal static FrameworkPackages WindowsDesktop { get; } = new(Net50, FrameworkNames.WindowsDesktopApp, NETCoreApp31.WindowsDesktop)
@@ -196,6 +203,8 @@ internal static class NETCoreApp50
196203
{ "System.Security.Principal.Windows", "5.0.0" },
197204
{ "System.Threading.AccessControl", "5.0.0" },
198205
{ "System.Windows.Extensions", "5.0.0" },
206+
// removed packages
207+
{ "System.Formats.Asn1", null },
199208
};
200209

201210
internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop);

src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net6.0.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ internal static class NETCoreApp60
159159
{ "System.IO.Pipelines", "6.0.0" },
160160
{ "System.Security.Cryptography.Pkcs", "6.0.0" },
161161
{ "System.Security.Cryptography.Xml", "6.0.0" },
162+
// removed packages
163+
{ "Microsoft.Win32.Registry", null },
164+
{ "System.Security.AccessControl", null },
165+
{ "System.Security.Cryptography.Cng", null },
166+
{ "System.Security.Permissions", null },
167+
{ "System.Security.Principal.Windows", null },
168+
{ "System.Windows.Extensions", null },
162169
};
163170

164171
internal static FrameworkPackages WindowsDesktop { get; } = new(Net60, FrameworkNames.WindowsDesktopApp, NETCoreApp50.WindowsDesktop)
@@ -178,6 +185,13 @@ internal static class NETCoreApp60
178185
{ "System.Security.Permissions", "6.0.0" },
179186
{ "System.Threading.AccessControl", "6.0.0" },
180187
{ "System.Windows.Extensions", "6.0.0" },
188+
// removed packages
189+
{ "Microsoft.Win32.Registry", null },
190+
{ "System.IO.FileSystem.AccessControl", null },
191+
{ "System.IO.Pipes.AccessControl", null },
192+
{ "System.Security.AccessControl", null },
193+
{ "System.Security.Cryptography.Cng", null },
194+
{ "System.Security.Principal.Windows", null },
181195
};
182196

183197
internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop);

src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net9.0.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ internal static class NETCoreApp90
180180
{ "System.Security.Cryptography.Pkcs", "8.0.1" },
181181
{ "System.Security.Cryptography.Xml", "9.0.0" },
182182
{ "System.Threading.RateLimiting", "9.0.0" },
183+
// removed packages
184+
{ "System.IO.Pipelines", null },
183185
};
184186

185187
internal static FrameworkPackages WindowsDesktop { get; } = new(Net90, FrameworkNames.WindowsDesktopApp, NETCoreApp80.WindowsDesktop)

src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp3.0.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ internal static class NETCoreApp30
3030
{ "System.Security.AccessControl", "4.6.0" },
3131
{ "System.Security.Cryptography.Cng", "4.6.0" },
3232
{ "System.Security.Cryptography.OpenSsl", "4.6.0" },
33-
{ "System.Security.Cryptography.Xml", "4.4.0" },
33+
// this package was listed in the package overrides.txt for netcoreapp3.0, but it is not actually in the targeting pack
34+
// { "System.Security.Cryptography.Xml", "4.4.0" },
3435
{ "System.Security.Principal.Windows", "4.6.0" },
3536
{ "System.Text.Encoding.CodePages", "4.6.0" },
3637
{ "System.Text.Encodings.Web", "4.6.0" },

src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netstandard2.1.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ internal static class NETStandard21
3737
{ "System.Runtime.Numerics", "4.3.0" },
3838
{ "System.Runtime.Serialization.Json", "4.3.0" },
3939
{ "System.Security.AccessControl", "4.4.0" },
40-
{ "System.Security.Cryptography.Xml", "4.4.0" },
40+
// this package was listed in the package overrides.txt for netstandard2.1, but it is not actually in the targeting pack
41+
// { "System.Security.Cryptography.Xml", "4.4.0" },
4142
{ "System.Security.Principal", "4.3.0" },
4243
{ "System.Security.Principal.Windows", "4.4.0" },
4344
{ "System.Threading", "4.3.0" },

0 commit comments

Comments
 (0)