From e3fb0e95d13840789703587f77a3dfaacbdff1f5 Mon Sep 17 00:00:00 2001 From: PointStar Date: Wed, 20 May 2026 13:14:58 +0300 Subject: [PATCH] fix(publish): stop git CRLF/LF normalization on ClickOnce bundle The install failed with "the file MarcusLaw.OutlookAddin.dll.config has a computed hash different from the one specified in the manifest" because git's core.autocrlf=true normalized the dll.config.deploy file from CRLF (as VS wrote it) to LF in the index. End users downloading via setup.exe from the Gitea raw URL got the LF version, whose SHA-1 differs from the hash recorded in dll.manifest at publish time. Add a .gitattributes that: - marks Publish/** as -text (no normalization, ever) - belt-and-braces marks *.deploy / *.manifest / *.vsto / *.application / *.pfx as binary globally git add --renormalize re-staged dll.config.deploy with its real CRLF bytes, so the hash in the manifest now matches the file on Gitea. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitattributes | 15 ++++ .../MarcusLaw.OutlookAddin.dll.config.deploy | 68 +++++++++---------- 2 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..409a644 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +* text=auto + +# ClickOnce publish output must be byte-identical to the hashes recorded +# in dll.manifest at publish time. Treat everything under Publish/ as +# binary so git's CRLF/LF normalization can't change the bytes between +# what VS published and what end-users download via setup.exe. +Publish/** -text + +# Defense in depth — apply the same rule to ClickOnce extensions +# regardless of where they live. +*.deploy binary +*.manifest binary +*.vsto binary +*.application binary +*.pfx binary diff --git a/Publish/Application Files/MarcusLaw.OutlookAddin_1_0_0_5/MarcusLaw.OutlookAddin.dll.config.deploy b/Publish/Application Files/MarcusLaw.OutlookAddin_1_0_0_5/MarcusLaw.OutlookAddin.dll.config.deploy index 242b1d2..e184124 100644 --- a/Publish/Application Files/MarcusLaw.OutlookAddin_1_0_0_5/MarcusLaw.OutlookAddin.dll.config.deploy +++ b/Publish/Application Files/MarcusLaw.OutlookAddin_1_0_0_5/MarcusLaw.OutlookAddin.dll.config.deploy @@ -1,35 +1,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file