From 923a0b657f34553aa264e3db1b5b2835f56808d1 Mon Sep 17 00:00:00 2001 From: Chaim Marcus Date: Mon, 11 May 2026 12:36:54 +0000 Subject: [PATCH] fix(host): enable AutoGenerateBindingRedirects for System.Text.Json deps VSTO csproj template disables binding redirects, but System.Text.Json's transitive deps (System.Text.Encodings.Web, System.Runtime.CompilerServices.Unsafe, System.Memory) ship as out-of-band NuGet packs whose versions diverge from .NET Framework 4.8's facade assemblies. Without redirects, the JIT loads the wrong Unsafe.dll for DefaultJavaScriptEncoder's static init, throwing FileLoadException wrapped in TypeInitializationException when SettingsManager.JsonOptions is touched. GenerateBindingRedirectsOutputType=true ensures the generated {MarcusLaw.OutlookAddin.dll}.config goes alongside the assembly so the VSTO loader actually sees it. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/OutlookAddin/OutlookAddin.csproj | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/OutlookAddin/OutlookAddin.csproj b/src/OutlookAddin/OutlookAddin.csproj index f14da14..9bfdd45 100644 --- a/src/OutlookAddin/OutlookAddin.csproj +++ b/src/OutlookAddin/OutlookAddin.csproj @@ -270,7 +270,12 @@ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false + + true + true true