From 56cfccb15d4b30323224bbe01eae0cad946c3969 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 4 Aug 2025 13:20:03 +0000
Subject: [PATCH 1/7] Initial plan
From e41281a60c1ed7528d97e1e7be9a022daff584a9 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 4 Aug 2025 13:30:00 +0000
Subject: [PATCH 2/7] Add ILLink.Descriptors.xml to Components.WebAssembly
project
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
---
.../WebAssembly/WebAssembly/src/ILLink.Descriptors.xml | 5 +++++
.../src/Microsoft.AspNetCore.Components.WebAssembly.csproj | 6 ++++++
2 files changed, 11 insertions(+)
create mode 100644 src/Components/WebAssembly/WebAssembly/src/ILLink.Descriptors.xml
diff --git a/src/Components/WebAssembly/WebAssembly/src/ILLink.Descriptors.xml b/src/Components/WebAssembly/WebAssembly/src/ILLink.Descriptors.xml
new file mode 100644
index 000000000000..204b24ec40db
--- /dev/null
+++ b/src/Components/WebAssembly/WebAssembly/src/ILLink.Descriptors.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj b/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
index f0418fd10354..418567779013 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
+++ b/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
@@ -65,4 +65,10 @@
+
+
+
+ ILLink.Descriptors.xml
+
+
From fc94643a6da6da0d4b5d312b0269d3772f855fe2 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 4 Aug 2025 19:05:31 +0000
Subject: [PATCH 3/7] Replace ILLink.Descriptors.xml with DynamicDependency
attribute for KeyValuePair preservation
Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
---
.../WebAssembly/WebAssembly/src/ILLink.Descriptors.xml | 5 -----
.../src/Microsoft.AspNetCore.Components.WebAssembly.csproj | 6 +-----
.../WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs | 1 +
3 files changed, 2 insertions(+), 10 deletions(-)
delete mode 100644 src/Components/WebAssembly/WebAssembly/src/ILLink.Descriptors.xml
diff --git a/src/Components/WebAssembly/WebAssembly/src/ILLink.Descriptors.xml b/src/Components/WebAssembly/WebAssembly/src/ILLink.Descriptors.xml
deleted file mode 100644
index 204b24ec40db..000000000000
--- a/src/Components/WebAssembly/WebAssembly/src/ILLink.Descriptors.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj b/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
index 418567779013..c1b4ccddc137 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
+++ b/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
@@ -66,9 +66,5 @@
-
-
- ILLink.Descriptors.xml
-
-
+
diff --git a/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs b/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
index b033a3fd5849..cbcbf784342f 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
+++ b/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
@@ -31,6 +31,7 @@ internal sealed partial class DefaultWebAssemblyJSRuntime : WebAssemblyJSRuntime
[DynamicDependency(nameof(BeginInvokeDotNet))]
[DynamicDependency(nameof(ReceiveByteArrayFromJS))]
[DynamicDependency(nameof(UpdateRootComponentsCore))]
+ [DynamicDependency(DynamicallyAccessedMemberTypes.All, "System.Collections.Generic.KeyValuePair`2", "System.Runtime")]
private DefaultWebAssemblyJSRuntime()
{
ElementReferenceContext = new WebElementReferenceContext(this);
From 5a2f695925619df13dce95c4315f8f4b188a4bf9 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 4 Aug 2025 19:22:43 +0000
Subject: [PATCH 4/7] Move DynamicDependency to public method and use typeof
instead of hardcoded strings
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>
---
.../WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs b/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
index cbcbf784342f..e2be3713c4ee 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
+++ b/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
@@ -31,13 +31,13 @@ internal sealed partial class DefaultWebAssemblyJSRuntime : WebAssemblyJSRuntime
[DynamicDependency(nameof(BeginInvokeDotNet))]
[DynamicDependency(nameof(ReceiveByteArrayFromJS))]
[DynamicDependency(nameof(UpdateRootComponentsCore))]
- [DynamicDependency(DynamicallyAccessedMemberTypes.All, "System.Collections.Generic.KeyValuePair`2", "System.Runtime")]
private DefaultWebAssemblyJSRuntime()
{
ElementReferenceContext = new WebElementReferenceContext(this);
JsonSerializerOptions.Converters.Add(new ElementReferenceJsonConverter(ElementReferenceContext));
}
+ [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(KeyValuePair<,>))]
public JsonSerializerOptions ReadJsonSerializerOptions() => JsonSerializerOptions;
[JSExport]
From f7f1da9971f07bfeff18f2479d5c2be8f2d7194d Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 4 Aug 2025 19:33:47 +0000
Subject: [PATCH 5/7] Use DynamicallyAccessedMemberTypes.PublicConstructors
instead of All for KeyValuePair
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>
---
.../WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs b/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
index e2be3713c4ee..e97e5dfc355d 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
+++ b/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
@@ -37,7 +37,7 @@ private DefaultWebAssemblyJSRuntime()
JsonSerializerOptions.Converters.Add(new ElementReferenceJsonConverter(ElementReferenceContext));
}
- [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(KeyValuePair<,>))]
+ [DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(KeyValuePair<,>))]
public JsonSerializerOptions ReadJsonSerializerOptions() => JsonSerializerOptions;
[JSExport]
From ba953377b2d3a1907df79569d7975938df567244 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 4 Aug 2025 20:40:09 +0000
Subject: [PATCH 6/7] Move DynamicDependency for KeyValuePair to private
constructor
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
---
.../WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs b/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
index e97e5dfc355d..2ed25052bcca 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
+++ b/src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs
@@ -31,13 +31,13 @@ internal sealed partial class DefaultWebAssemblyJSRuntime : WebAssemblyJSRuntime
[DynamicDependency(nameof(BeginInvokeDotNet))]
[DynamicDependency(nameof(ReceiveByteArrayFromJS))]
[DynamicDependency(nameof(UpdateRootComponentsCore))]
+ [DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(KeyValuePair<,>))]
private DefaultWebAssemblyJSRuntime()
{
ElementReferenceContext = new WebElementReferenceContext(this);
JsonSerializerOptions.Converters.Add(new ElementReferenceJsonConverter(ElementReferenceContext));
}
- [DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(KeyValuePair<,>))]
public JsonSerializerOptions ReadJsonSerializerOptions() => JsonSerializerOptions;
[JSExport]
From 4c78ccd784fb9c9473d4e8a12c0481e91447f14c Mon Sep 17 00:00:00 2001
From: Javier Calvarro Nelson
Date: Tue, 5 Aug 2025 11:20:14 +0200
Subject: [PATCH 7/7] Update
src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
Remove empty lines
---
.../src/Microsoft.AspNetCore.Components.WebAssembly.csproj | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj b/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
index c1b4ccddc137..f0418fd10354 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
+++ b/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
@@ -65,6 +65,4 @@
-
-