From dcdfc79bdc6d6961615f9da436ee373cab7cec55 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Mon, 31 Aug 2026 16:55:49 +0500 Subject: [PATCH 1/3] Added ExcelAgent AOT build. --- ExcelDna.Testing/Directory.Build.targets | 7 +++--- ExcelDna.Testing/Examples/Examples.csproj | 6 ++--- .../ExcelAgent/ExcelAgent-AddIn.dna | 23 ------------------ ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj | 24 +++++++++++++++++-- 4 files changed, 29 insertions(+), 31 deletions(-) delete mode 100644 ExcelDna.Testing/ExcelAgent/ExcelAgent-AddIn.dna diff --git a/ExcelDna.Testing/Directory.Build.targets b/ExcelDna.Testing/Directory.Build.targets index 5ece0e3..d12fad8 100644 --- a/ExcelDna.Testing/Directory.Build.targets +++ b/ExcelDna.Testing/Directory.Build.targets @@ -1,7 +1,8 @@ - - - + + + + diff --git a/ExcelDna.Testing/Examples/Examples.csproj b/ExcelDna.Testing/Examples/Examples.csproj index e197164..9695592 100644 --- a/ExcelDna.Testing/Examples/Examples.csproj +++ b/ExcelDna.Testing/Examples/Examples.csproj @@ -1,7 +1,7 @@  - net472;net6.0-windows + net472;net6.0-windows;net9.0-windows true true @@ -16,7 +16,7 @@ - + @@ -35,7 +35,7 @@ - + \ No newline at end of file diff --git a/ExcelDna.Testing/ExcelAgent/ExcelAgent-AddIn.dna b/ExcelDna.Testing/ExcelAgent/ExcelAgent-AddIn.dna deleted file mode 100644 index 4c17a04..0000000 --- a/ExcelDna.Testing/ExcelAgent/ExcelAgent-AddIn.dna +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj b/ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj index 0c382d6..561e5b2 100644 --- a/ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj +++ b/ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj @@ -1,11 +1,31 @@  - net472;net6.0-windows + net472;net6.0-windows;net10.0-windows - + + win-x64 + true + true + + + + + true + + + + + + + + + + + + From 4024428307ef5c5db5ca3d6635ba702d4ada4e54 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Sun, 27 Sep 2026 17:13:28 +0500 Subject: [PATCH 2/3] Fixed RPC trimming. --- ExcelDna.Testing/Directory.Build.targets | 6 +++--- ExcelDna.Testing/ExcelAgent/Addin.cs | 4 ++++ ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj | 9 +++++++-- .../ExcelDna.Testing/ExcelDna.Testing.csproj | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ExcelDna.Testing/Directory.Build.targets b/ExcelDna.Testing/Directory.Build.targets index d12fad8..d261d56 100644 --- a/ExcelDna.Testing/Directory.Build.targets +++ b/ExcelDna.Testing/Directory.Build.targets @@ -1,8 +1,8 @@ - - - + + + diff --git a/ExcelDna.Testing/ExcelAgent/Addin.cs b/ExcelDna.Testing/ExcelAgent/Addin.cs index d44419f..3d6dd3a 100644 --- a/ExcelDna.Testing/ExcelAgent/Addin.cs +++ b/ExcelDna.Testing/ExcelAgent/Addin.cs @@ -23,6 +23,10 @@ public void AutoClose() } #pragma warning disable VSTHRD100 +#if NET10_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods, typeof(ExcelDna.Testing.Remote.RemoteExcel))] + [System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All, typeof(ExcelDna.Testing.Remote.RemoteExcel))] +#endif private async void StartRPC() { try diff --git a/ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj b/ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj index 561e5b2..de53180 100644 --- a/ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj +++ b/ExcelDna.Testing/ExcelAgent/ExcelAgent.csproj @@ -15,7 +15,7 @@ true - + @@ -26,7 +26,12 @@ - + + + + + + diff --git a/ExcelDna.Testing/ExcelDna.Testing/ExcelDna.Testing.csproj b/ExcelDna.Testing/ExcelDna.Testing/ExcelDna.Testing.csproj index 75e91e9..8a8415a 100644 --- a/ExcelDna.Testing/ExcelDna.Testing/ExcelDna.Testing.csproj +++ b/ExcelDna.Testing/ExcelDna.Testing/ExcelDna.Testing.csproj @@ -11,7 +11,7 @@ - + From 829a30172d554a422dc0e37bb40b772ef37eb733 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Wed, 30 Sep 2026 17:00:33 +0500 Subject: [PATCH 3/3] Corrected AssemblyInfo marshaling for AOT. --- .../ExcelDna.Testing/Remote/AssemblyInfo.cs | 33 +++++++++++++++++++ .../ExcelDna.Testing/Remote/RemoteExcel.cs | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 ExcelDna.Testing/ExcelDna.Testing/Remote/AssemblyInfo.cs diff --git a/ExcelDna.Testing/ExcelDna.Testing/Remote/AssemblyInfo.cs b/ExcelDna.Testing/ExcelDna.Testing/Remote/AssemblyInfo.cs new file mode 100644 index 0000000..95375a1 --- /dev/null +++ b/ExcelDna.Testing/ExcelDna.Testing/Remote/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using System.IO; +using Xunit.Abstractions; + +namespace ExcelDna.Testing.Remote +{ + public class AssemblyInfo : IAssemblyInfo + { + public AssemblyInfo(string path) + { + AssemblyPath = path; + } + + public string AssemblyPath { get; } + + public string Name => Path.GetFileNameWithoutExtension(AssemblyPath); + + public IEnumerable GetCustomAttributes(string assemblyQualifiedAttributeTypeName) + { + throw new System.NotImplementedException(); + } + + public ITypeInfo GetType(string typeName) + { + throw new System.NotImplementedException(); + } + + public IEnumerable GetTypes(bool includePrivateTypes) + { + throw new System.NotImplementedException(); + } + } +} diff --git a/ExcelDna.Testing/ExcelDna.Testing/Remote/RemoteExcel.cs b/ExcelDna.Testing/ExcelDna.Testing/Remote/RemoteExcel.cs index 785132a..dfbaa4e 100644 --- a/ExcelDna.Testing/ExcelDna.Testing/Remote/RemoteExcel.cs +++ b/ExcelDna.Testing/ExcelDna.Testing/Remote/RemoteExcel.cs @@ -25,7 +25,7 @@ public class RemoteExcel : IRemoteExcel public async Task RunTestsAsync(string testAssemblyPath, string testAssemblyConfigurationFile, string[] testCases) { - var testAssembly = new TestAssembly(new ReflectionAssemblyInfo(Assembly.LoadFrom(testAssemblyPath)), testAssemblyConfigurationFile); + var testAssembly = new TestAssembly(new AssemblyInfo(testAssemblyPath), testAssemblyConfigurationFile, new Version(0, 0, 0, 0)); MessageBusProxy messageBusProxy = new MessageBusProxy(SendBusMessage); RemoteTestAssemblyRunner runner = new RemoteTestAssemblyRunner(testAssembly, testCases.Select(i => ExcelTestCase.DeserializeFromString(i)), null, null, new TestFrameworkOptions(), messageBusProxy); return await runner.RunAsync();