From 6f8953ccb92fea96fb1d2ae017d9c1ad7e5c6013 Mon Sep 17 00:00:00 2001 From: w0rldx Date: Sat, 8 Aug 2026 19:36:44 +0200 Subject: [PATCH] fix(win): resolve apphost license pack from the SDK-chosen apphost path The apphost-license copy target hardcoded the NuGet global cache path. That only works when the installed SDK downloads the pinned apphost pack to the cache; a machine whose SDK BUNDLES $(DotNetRuntimeVersion) serves the apphost from its own packs/ dir and never populates the cache, so the build failed with 'apphost MIT license is missing from the restored host pack'. Derive the pack directory from $(AppHostSourcePath) (the exact apphost the SDK resolved), with the old cache path as fallback. Verified: Release build clean; RuntimeLicensePackagingTests 5/5; launcher publish copies both license assets. --- .../XE-Local-AI-Engine.WindowsLauncher.csproj | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/XE-Local-AI-Engine.WindowsLauncher/XE-Local-AI-Engine.WindowsLauncher.csproj b/XE-Local-AI-Engine.WindowsLauncher/XE-Local-AI-Engine.WindowsLauncher.csproj index 6f0afcd7..a18d3cdd 100644 --- a/XE-Local-AI-Engine.WindowsLauncher/XE-Local-AI-Engine.WindowsLauncher.csproj +++ b/XE-Local-AI-Engine.WindowsLauncher/XE-Local-AI-Engine.WindowsLauncher.csproj @@ -10,7 +10,15 @@ BeforeTargets="ComputeFilesToPublish" Condition="'$(UseAppHost)' == 'true' and $(RuntimeIdentifier.StartsWith('win-'))"> - <_WindowsApphostPackDirectory>$(NuGetPackageRoot)microsoft.netcore.app.host.$(RuntimeIdentifier)/$(DotNetRuntimeVersion) + + <_WindowsApphostPackDirectory Condition="'$(AppHostSourcePath)' != ''">$([System.IO.Path]::GetFullPath('$([System.IO.Path]::GetDirectoryName($(AppHostSourcePath)))/../../..')) + <_WindowsApphostPackDirectory Condition="'$(_WindowsApphostPackDirectory)' == '' or !Exists('$(_WindowsApphostPackDirectory)/LICENSE.TXT')">$(NuGetPackageRoot)microsoft.netcore.app.host.$(RuntimeIdentifier)/$(DotNetRuntimeVersion)