fix(ci): set NUGET_PACKAGES outside system32 (NETSDK1064 fix)

NuGet ignores our service-level USERPROFILE override (it uses
SHGetKnownFolderPath which returns LocalSystem's profile regardless of
the env var) and installs packages to C:\Windows\system32\configsystemprofile\.nuget\packages. 32-bit MSBuild then can't find them because
the Win32 File System Redirector silently shunts system32 paths to
SysWOW64 for 32-bit processes -> NETSDK1064 'package not found'.

NUGET_PACKAGES is NuGet's highest-priority package-folder override and
puts everything outside system32, so both restore and build agree on
paths and the redirector never gets involved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 16:06:16 +00:00
parent a1e25af86b
commit 399fd24f4d
+7
View File
@@ -11,6 +11,13 @@ env:
REGISTRY: gitea.dev.marcus-law.co.il
CDN_IMAGE_NAME: espocrm-extensions/outlook-addin-cdn
PROVIDER_URL: 'https://platform.dev.marcus-law.co.il/outlook-addin/OutlookAddin.vsto'
# Force NuGet to install + resolve packages outside C:\Windows\System32\.
# NuGet's UserProfile lookup uses SHGetKnownFolderPath which ignores our
# USERPROFILE override and returns the LocalSystem profile when the runner
# service runs as LocalSystem. 32-bit MSBuild then hits Win32 File System
# Redirector and "loses" packages -> NETSDK1064. NUGET_PACKAGES short-
# circuits the lookup and keeps everything outside system32.
NUGET_PACKAGES: 'C:\actions-home\.nuget\packages'
jobs:
build: