Fix self-contained builds: pin SDK, isolate TFMs, add local NuGet feed#4
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
ayersdecker
June 23, 2026 23:53
View session
There was a problem hiding this comment.
Pull request overview
This pull request aims to make builds more self-contained and reliable across CI/local environments by pinning the .NET SDK, preventing unintended cross-TFM project builds, and enabling in-repo package restores via a local NuGet feed.
Changes:
- Add a
global.jsonto pin the repo’s .NET SDK and control roll-forward behavior. - Adjust
MinimalDemo’sProjectReferenceto build only the currently targeted TFM. - Introduce NuGet configuration for a local
artifacts/nugetfeed (repo-wide) and provide a templatenuget.configfor scaffolded MAUI projects.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
global.json |
Pins the .NET SDK selection to avoid unintended SDK/tooling drift on runners. |
samples/MinimalDemo/MinimalDemo.csproj |
Ensures the referenced framework project builds only the active target framework. |
nuget.config |
Adds a local package source and package source mapping to support in-repo development packages. |
templates/maui-ferrum/nuget.config |
Adds a scaffolded NuGet config to guide consumers on using a local feed during development. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+29
| <packageSources> | ||
| <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||
| <add key="local-packages" value="artifacts/nuget" /> | ||
| </packageSources> | ||
| <packageSourceMapping> | ||
| <!-- Ferrum.* packages come from the local feed (or nuget.org once published). --> | ||
| <packageSource key="local-packages"> | ||
| <package pattern="Ferrum.*" /> | ||
| </packageSource> | ||
| <!-- Everything else comes from nuget.org. --> | ||
| <packageSource key="nuget.org"> | ||
| <package pattern="*" /> | ||
| </packageSource> | ||
| </packageSourceMapping> |
Comment on lines
+11
to
+24
| Then update the "local-packages" source below to point at that directory. | ||
| Once the package is published to NuGet.org you can remove this file or leave | ||
| it — the packageSourceMapping ensures only Ferrum.* resolves locally. | ||
| --> | ||
| <configuration> | ||
| <packageSources> | ||
| <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||
| <!-- Uncomment and point at the artifacts/nuget directory produced by | ||
| dotnet pack src/Framework/Ferrum.Framework.csproj -o artifacts/nuget | ||
| (relative paths are resolved from the directory containing this file): | ||
| <add key="local-packages" value="artifacts/nuget" /> | ||
| --> | ||
| </packageSources> | ||
| </configuration> |
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.
CI builds were failing because the repo had no SDK pin (letting .NET 10 on runners shadow the intended 9.x install) and no mechanism to resolve
Ferrum.*packages locally. TheMinimalDemoproject reference also forced all TFMs to build even when targeting a single platform.Changes
global.json— pins SDK to9.0.x(latestMinor). Prevents macOS/Ubuntu runners with .NET 10 pre-installed from picking SDK 10 for workload installs; iOS MAUI workload under SDK 10 resolvednet9.0-iosband26.5.9002, which requires Xcode 26.5 (only 16.2 available).samples/MinimalDemo/MinimalDemo.csproj— addsSetTargetFramework=$(TargetFramework)to theFerrum.Frameworkproject reference:Without this,
dotnet build -f net9.0-androidstill compiled all TFMs of the referenced project (includingnet9.0-ios), failing on Android-only runners that lack the iOS workload.nuget.config(repo root) — declares alocal-packagesfeed atartifacts/nugetwith package-source mapping scopingFerrum.*to it. Eliminates the dependency onFerrum.*being published to NuGet.org for in-repo development; pack locally intoartifacts/nugetand all consumers restore without issue.templates/maui-ferrum/nuget.config— scaffolded projects carry a ready-to-uncomment local feed config so users developing against a local Ferrum build have a clear path without additional setup.