Skip to content

Commit e6ac0dc

Browse files
Ship DiagnosticSource and Text.Encodings.Web v10 for PowerShell 7+ (#29763)
Co-authored-by: Yeming Liu <11371776+isra-fel@users.noreply.github.com>
1 parent e7b8380 commit e6ac0dc

7 files changed

Lines changed: 38 additions & 24 deletions

File tree

src/Accounts/AssemblyLoading.Test/UnitTests/ConditionalAssemblyProviderTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public void CanGetAssembliesOnWindowsPowerShell()
4848

4949
Assert.True(assemblies.TryGetValue("Azure.Identity", out var azureIdentity));
5050
Assert.Equal(GetExpectedAssemblyPath(NetStandard20, "Azure.Identity"), azureIdentity.Path);
51+
52+
Assert.True(assemblies.TryGetValue("System.Text.Encodings.Web", out var encodingsWeb));
53+
Assert.Equal(GetExpectedAssemblyPath(NetStandard20, "System.Text.Encodings.Web"), encodingsWeb.Path);
54+
Assert.True(assemblies.TryGetValue("System.Text.Json", out var textJson));
55+
Assert.Equal(GetExpectedAssemblyPath(NetStandard20, "System.Text.Json"), textJson.Path);
56+
Assert.True(assemblies.TryGetValue("System.Diagnostics.DiagnosticSource", out var diagnosticSource));
57+
Assert.Equal(GetExpectedAssemblyPath(NetStandard20, "System.Diagnostics.DiagnosticSource"), diagnosticSource.Path);
5158
}
5259

5360
[Fact]
@@ -71,6 +78,13 @@ public void CanGetAssembliesOnPowerShellCorePlus()
7178

7279
Assert.True(assemblies.TryGetValue("Azure.Identity", out var azureIdentity));
7380
Assert.Equal(GetExpectedAssemblyPath(NetStandard20, "Azure.Identity"), azureIdentity.Path);
81+
82+
Assert.True(assemblies.TryGetValue("System.Text.Encodings.Web", out var encodingsWeb));
83+
Assert.Equal(GetExpectedAssemblyPath(NetStandard20, "System.Text.Encodings.Web"), encodingsWeb.Path);
84+
Assert.True(assemblies.TryGetValue("System.Text.Json", out var textJson));
85+
Assert.Equal(GetExpectedAssemblyPath(NetStandard20, "System.Text.Json"), textJson.Path);
86+
Assert.True(assemblies.TryGetValue("System.Diagnostics.DiagnosticSource", out var diagnosticSource));
87+
Assert.Equal(GetExpectedAssemblyPath(NetStandard20, "System.Diagnostics.DiagnosticSource"), diagnosticSource.Path);
7488
}
7589

7690
private string GetExpectedAssemblyPath(string framework, string assemblyName)

src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ public static void Initialize(string rootPath, IConditionalAssemblyContext conte
4646
CreateAssembly("net46", "System.Xml.ReaderWriter", "4.1.0.0").WithWindowsPowerShell(),
4747
CreateAssembly("net461", "System.Reflection.DispatchProxy", "4.0.4.0").WithWindowsPowerShell(),
4848
CreateAssembly("net461", "System.Security.Cryptography.ProtectedData", "4.0.3.0").WithWindowsPowerShell(),
49-
CreateAssembly("net462", "System.Diagnostics.DiagnosticSource", "10.0.0.3").WithWindowsPowerShell(),
5049
CreateAssembly("net462", "System.Numerics.Vectors", "4.1.6.0").WithWindowsPowerShell(),
5150
CreateAssembly("net462", "System.Runtime.CompilerServices.Unsafe", "6.0.3.0").WithWindowsPowerShell(),
52-
CreateAssembly("net462", "System.Text.Encodings.Web", "10.0.0.3").WithWindowsPowerShell(),
5351
CreateAssembly("net47", "System.Security.Cryptography.Cng", "5.0.0.0").WithWindowsPowerShell(),
5452
CreateAssembly("net47", "System.ValueTuple", "4.0.3.0").WithWindowsPowerShell(),
5553
CreateAssembly("netstandard2.0", "Azure.Core", "1.56.0.0"),
@@ -71,6 +69,7 @@ public static void Initialize(string rootPath, IConditionalAssemblyContext conte
7169
CreateAssembly("netstandard2.0", "Microsoft.IdentityModel.Abstractions", "8.14.0.0"),
7270
CreateAssembly("netstandard2.0", "System.Buffers", "4.0.2.0").WithWindowsPowerShell(),
7371
CreateAssembly("netstandard2.0", "System.ClientModel", "1.12.0.0"),
72+
CreateAssembly("netstandard2.0", "System.Diagnostics.DiagnosticSource", "10.0.0.0"),
7473
CreateAssembly("netstandard2.0", "System.Formats.Asn1", "8.0.0.0").WithWindowsPowerShell(),
7574
CreateAssembly("netstandard2.0", "System.IO.Pipelines", "10.0.0.0"),
7675
CreateAssembly("netstandard2.0", "System.Memory.Data", "10.0.0.3"),
@@ -81,6 +80,7 @@ public static void Initialize(string rootPath, IConditionalAssemblyContext conte
8180
CreateAssembly("netstandard2.0", "System.Security.Permissions", "4.0.3.0").WithWindowsPowerShell(),
8281
CreateAssembly("netstandard2.0", "System.Security.Principal.Windows", "4.1.3.0").WithWindowsPowerShell(),
8382
CreateAssembly("netstandard2.0", "System.ServiceModel.Primitives", "4.7.0.0").WithWindowsPowerShell(),
83+
CreateAssembly("netstandard2.0", "System.Text.Encodings.Web", "10.0.0.0"),
8484
CreateAssembly("netstandard2.0", "System.Text.Json", "10.0.0.0"),
8585
CreateAssembly("netstandard2.0", "System.Threading.Tasks.Extensions", "4.2.1.0").WithWindowsPowerShell(),
8686
#endregion

src/lib/cgmanifest.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,6 @@
3838
}
3939
}
4040
},
41-
{
42-
"component": {
43-
"type": "nuget",
44-
"nuget": {
45-
"name": "System.Diagnostics.DiagnosticSource",
46-
"version": "10.0.3"
47-
}
48-
}
49-
},
5041
{
5142
"component": {
5243
"type": "nuget",
@@ -65,15 +56,6 @@
6556
}
6657
}
6758
},
68-
{
69-
"component": {
70-
"type": "nuget",
71-
"nuget": {
72-
"name": "System.Text.Encodings.Web",
73-
"version": "10.0.3"
74-
}
75-
}
76-
},
7759
{
7860
"component": {
7961
"type": "nuget",
@@ -263,6 +245,15 @@
263245
}
264246
}
265247
},
248+
{
249+
"component": {
250+
"type": "nuget",
251+
"nuget": {
252+
"name": "System.Diagnostics.DiagnosticSource",
253+
"version": "10.0.3"
254+
}
255+
}
256+
},
266257
{
267258
"component": {
268259
"type": "nuget",
@@ -353,6 +344,15 @@
353344
}
354345
}
355346
},
347+
{
348+
"component": {
349+
"type": "nuget",
350+
"nuget": {
351+
"name": "System.Text.Encodings.Web",
352+
"version": "10.0.3"
353+
}
354+
}
355+
},
356356
{
357357
"component": {
358358
"type": "nuget",

src/lib/manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@
227227
{
228228
"PackageName": "System.Diagnostics.DiagnosticSource",
229229
"PackageVersion": "10.0.3",
230-
"TargetFramework": "net462",
230+
"TargetFramework": "netstandard2.0",
231231
"WindowsPowerShell": true,
232-
"PowerShell7Plus": false
232+
"PowerShell7Plus": true
233233
},
234234
{
235235
"PackageName": "System.Numerics.Vectors",
@@ -269,9 +269,9 @@
269269
{
270270
"PackageName": "System.Text.Encodings.Web",
271271
"PackageVersion": "10.0.3",
272-
"TargetFramework": "net462",
272+
"TargetFramework": "netstandard2.0",
273273
"WindowsPowerShell": true,
274-
"PowerShell7Plus": false
274+
"PowerShell7Plus": true
275275
},
276276
{
277277
"PackageName": "System.ValueTuple",
-218 KB
Binary file not shown.
205 KB
Binary file not shown.
85.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)