Fix LT-22509: Newtonsoft.Json Method not found error#879
Fix LT-22509: Newtonsoft.Json Method not found error#879jasonleenaylor wants to merge 3 commits into
Conversation
b96a01d to
bd5e06c
Compare
- Newtonsoft.Json doesn't change assembly versions on minor version bumps. 13.0.4 added a method and we started using it in libpalaso. If a version less than that is installed in the GAC our local version would not be loaded. This patch enforces using our local copy by our application. Change-Id: I9b7cdfbe792fda13b3dcc570c2c5dc8d19e6d596
bd5e06c to
7908ff0
Compare
- Newtonsoft.Json doesn't change assembly versions on minor version bumps. 13.0.4 added a method and we started using it in libpalaso. If a version less than that is installed in the GAC our local version would not be loaded. This patch enforces using our local copy by our application. Change-Id: I9b7cdfbe792fda13b3dcc570c2c5dc8d19e6d596
7908ff0 to
05ba6cc
Compare
Change-Id: I8255b5a9f413d76bb053a9a552ba6b08ad74b2fa
05ba6cc to
63c5255
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Addresses LT-22509 by ensuring the installer ships and “owns” Newtonsoft.Json.dll so an older GAC-installed copy can’t cause runtime “method not found” failures.
Changes:
- Author explicit WiX components for
Newtonsoft.Json.dll(private app copy + optional GAC install) behind<?ifdef MASTERBUILDDIR?>. - Add Heat harvest exclusion lists and extend
KeyPathFix.xslto drop excluded single-file Heat components and their danglingComponentRefs. - Update both WiX 6 and WiX 3 (legacy PatchableInstaller) build flows/documentation to keep harvest + patch behavior consistent.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| FLExInstaller/wix6/Shared/Common/CustomComponents.wxi | Adds authored Newtonsoft.Json.dll components for WiX 6 builds (app + GAC). |
| FLExInstaller/wix6/Shared/Base/heat-exclude.xml | Defines WiX 6 Heat exclusions (currently Newtonsoft.Json.dll). |
| FLExInstaller/wix6/Shared/Base/KeyPathFix.xsl | Filters out excluded Heat components and cleans dangling refs; keeps KeyPath adjustments. |
| FLExInstaller/wix6/Shared/Base/Framework.wxs | Wires new Newtonsoft components into Feature Complete when MASTERBUILDDIR is set. |
| FLExInstaller/wix6/FieldWorks.Installer.wixproj | Documents/clarifies Heat usage; mostly formatting. |
| FLExInstaller/PatchableInstallerHeatExclude.xml | Defines legacy WiX 3 Heat exclusions for PatchableInstaller. |
| FLExInstaller/CustomFeatures.wxi | Adds guarded ComponentRefs for Newtonsoft components in legacy feature authoring. |
| FLExInstaller/CustomComponents.wxi | Adds authored Newtonsoft components into legacy (WiX 3) component authoring. |
| FLExInstaller/AGENTS.md | Documents Heat exclusion + -fv servicing behavior and the guarding pattern. |
| Build/Installer.targets | Whitespace/indentation-only change. |
| Build/Installer.legacy.targets | Copies legacy heat-exclude.xml into PatchableInstaller tree before harvest/build. |
| <xsl:template match="*[local-name()='ComponentRef']" priority="2"> | ||
| <xsl:variable name="rid" select="@Id"/> | ||
| <xsl:variable name="comp" select="//*[local-name()='Component'][@Id = $rid]"/> |
| <xsl:variable name="isExcluded"> | ||
| <xsl:for-each select="document('heat-exclude.xml')"> | ||
| <xsl:value-of select="count(/*[local-name()='HeatHarvestExcludes']/*[local-name()='Exclude'][@Name and translate(@Name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = translate($base, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')])"/> | ||
| </xsl:for-each> | ||
| </xsl:variable> |
| <Component Id="NewtonsoftJsonGac" Guid="*"> | ||
| <File Id="NewtonsoftJsonFileGac" | ||
| Name="Newtonsoft.Json.dll" | ||
| Source="$(var.MASTERBUILDDIR)\Newtonsoft.Json.dll" | ||
| KeyPath="yes" | ||
| Assembly=".net" /> | ||
| </Component> |
| <_FieldWorksPatchableInstallerHeatExclude>$([MSBuild]::NormalizePath('$(fwrt)', 'FLExInstaller', 'PatchableInstallerHeatExclude.xml'))</_FieldWorksPatchableInstallerHeatExclude> | ||
| <_PatchableInstallerHeatExcludeDest>$([MSBuild]::NormalizePath('$(fwrt)', 'PatchableInstaller', 'BaseInstallerBuild', 'heat-exclude.xml'))</_PatchableInstallerHeatExcludeDest> | ||
| </PropertyGroup> | ||
| <Copy | ||
| SourceFiles="$(_FieldWorksPatchableInstallerHeatExclude)" | ||
| DestinationFiles="$(_PatchableInstallerHeatExcludeDest)" | ||
| SkipUnchangedFiles="false" | ||
| Condition="Exists('$(_FieldWorksPatchableInstallerHeatExclude)')" | ||
| /> |
|
Initial AI review (unfiltered): Assessment
Recommendations
Net: Copilot’s WiX 6 servicing comment is the one to act on, the MakeDir comment is minor, and the external genericinstaller inspection exposed a larger issue Copilot did not call out: the legacy installer behavior described by this PR is not implemented in the installer repo it depends on. I can do a manual review after this. |
|
From Devin: The generic installer repo has already been updated with those in the most recent commit (sillsdev/genericinstaller@173675f) I don't think this type of action (gac registration) can run on a patch in the way that we are generating them from the genericinstaller. It may even be outside of the typical patch workflow for windows installer where only file diffs are expected in an .msp (by my understanding) I think there is a misleading wix6 comment, but otherwise this code seems to be correct to me. |
This change is