From 064cfeb75d7c7345d5222c2a59fc9b93b3471ba2 Mon Sep 17 00:00:00 2001 From: erwan-joly Date: Fri, 24 Apr 2026 15:17:50 +1200 Subject: [PATCH] fix: use conditional Directory.Build.props for NOSCORE_LOCAL_PACKAGES Putting the local source in NuGet.config as %NOSCORE_LOCAL_PACKAGES% fails NU1301 on restore when the env var is unset (CI runners, fresh clones) because NuGet treats the literal %VAR% as a path. Move the wiring to Directory.Build.props with a Condition that only adds RestoreAdditionalProjectSources when the env var is set. Devs who want local packages just set NOSCORE_LOCAL_PACKAGES; everyone else is unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) --- Directory.Build.props | 5 +++++ NuGet.config | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..47580df --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,5 @@ + + + $(RestoreAdditionalProjectSources);$(NOSCORE_LOCAL_PACKAGES) + + \ No newline at end of file diff --git a/NuGet.config b/NuGet.config index edec104..3eda83b 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,6 @@ - \ No newline at end of file