Fix LibLCM .NET 8 CI builds - #394
Merged
Merged
Conversation
Pin SDK selection to .NET 8 and rely on the central per-framework OutputPath instead of overriding OutDir in SIL.LCModel. This prevents net8 artifacts from contaminating netstandard output on hosted runners.
johnml1135
force-pushed
the
fix/pin-dotnet8-ci
branch
from
August 13, 2026 08:10
7864d6d to
ec74241
Compare
johnml1135
requested review from
hahn-kev and
jasonleenaylor
and removed request for
hahn-kev and
jasonleenaylor
August 13, 2026 08:26
hahn-kev
approved these changes
Aug 13, 2026
thejambi
pushed a commit
that referenced
this pull request
Aug 14, 2026
Pin SDK selection to .NET 8 and rely on the central per-framework OutputPath instead of overriding OutDir in SIL.LCModel. This prevents net8 artifacts from contaminating netstandard output on hosted runners.
thejambi
added a commit
that referenced
this pull request
Aug 14, 2026
* Fix Windows CI by scoping IntermediateOutputPath per framework Directory.Build.props sets AppendTargetFrameworkToOutputPath=false so that OutputPath can place output under artifacts/$(Configuration)/$(TargetFramework) itself. That flag also strips $(TargetFramework) from IntermediateOutputPath, so all three target frameworks of a multi-targeted project shared a single obj folder - including the reference assembly under obj/ref. Whichever framework built last owned it. ProjectReference resolution reads that reference assembly, so the netstandard2.0 compile of SIL.LCModel could be handed the net8.0 build of SIL.LCModel.Core: CSC : error CS1705: Assembly 'SIL.LCModel.Core' ... uses 'System.Drawing.Primitives, Version=8.0.0.0' which has a higher version than referenced assembly 'System.Drawing.Primitives, Version=4.0.2.0' [SIL.LCModel.csproj::TargetFramework=netstandard2.0] Build ordering decided whether this hit, which is why Windows failed while Linux stayed green. #394 removed the OutDir override in SIL.LCModel and fixed the bin side of the same problem; the intermediate side kept sharing one path. Set IntermediateOutputPath to obj/$(Configuration)/$(TargetFramework)/ in Directory.Build.props, and drop the obj/x86/$(Configuration)/ override in SIL.LCModel.Core.csproj that predates multi-targeting and now conflicts with it - Platform is Any CPU repo-wide, so the x86 segment bought nothing. OutputPath and the artifacts layout are unchanged. * Remove comments Co-Authored-By: Zachary Burnham <zachary_burnham@sil.org> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
thejambi
added a commit
that referenced
this pull request
Aug 14, 2026
* Fix Windows CI by scoping IntermediateOutputPath per framework Directory.Build.props sets AppendTargetFrameworkToOutputPath=false so that OutputPath can place output under artifacts/$(Configuration)/$(TargetFramework) itself. That flag also strips $(TargetFramework) from IntermediateOutputPath, so all three target frameworks of a multi-targeted project shared a single obj folder - including the reference assembly under obj/ref. Whichever framework built last owned it. ProjectReference resolution reads that reference assembly, so the netstandard2.0 compile of SIL.LCModel could be handed the net8.0 build of SIL.LCModel.Core: CSC : error CS1705: Assembly 'SIL.LCModel.Core' ... uses 'System.Drawing.Primitives, Version=8.0.0.0' which has a higher version than referenced assembly 'System.Drawing.Primitives, Version=4.0.2.0' [SIL.LCModel.csproj::TargetFramework=netstandard2.0] Build ordering decided whether this hit, which is why Windows failed while Linux stayed green. #394 removed the OutDir override in SIL.LCModel and fixed the bin side of the same problem; the intermediate side kept sharing one path. Set IntermediateOutputPath to obj/$(Configuration)/$(TargetFramework)/ in Directory.Build.props, and drop the obj/x86/$(Configuration)/ override in SIL.LCModel.Core.csproj that predates multi-targeting and now conflicts with it - Platform is Any CPU repo-wide, so the x86 segment bought nothing. OutputPath and the artifacts layout are unchanged. * Remove comments Co-Authored-By: Zachary Burnham <zachary_burnham@sil.org> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OutDiroverride so multi-target inner builds use the per-frameworkOutputPathfromDirectory.Build.props.Why
The hosted Windows runner selected .NET 10 because
global.jsonallowedlatestMajor. Pinning the SDK exposed an existing multi-target output collision on both Windows and Ubuntu: anet8.0SIL.LCModel.Core.dllcould be written toartifacts/Release/netstandard2.0, causing CS1705 when the netstandardSIL.LCModeltarget consumed it.The project-level
OutDirduplicated the repository-wideOutputPathand allowed a parent target's output directory to leak into referenced inner builds. Letting the SDK deriveOutDirfrom the centralOutputPathkeepsnetstandard2.0,net462, andnet8.0outputs separate.Validation
dotnet --version: 8.0.424dotnet build LCM.sln --configuration Release: passed with 0 errorsdotnet pack LCM.sln --include-symbols --no-restore --no-build -p:SymbolPackageFormat=snupkg --configuration Release: all packages createdThis change is