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)