From 6430e1d61c21d5890e187f3fd9c0f3dcb7cf6b67 Mon Sep 17 00:00:00 2001 From: Archy <59789660+IceCryptonym@users.noreply.github.com> Date: Mon, 17 Jul 2023 19:04:19 +1000 Subject: [PATCH] Fix designer DLL not found when NUGET_PACKAGES is set --- AvantGarde/Loading/RemoteLoader.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/AvantGarde/Loading/RemoteLoader.cs b/AvantGarde/Loading/RemoteLoader.cs index 3daa80c..c044af7 100644 --- a/AvantGarde/Loading/RemoteLoader.cs +++ b/AvantGarde/Loading/RemoteLoader.cs @@ -158,10 +158,15 @@ public static PathItem FindDesignerHost(string? version) // ~/.nuget/packages/avalonia//tools/netcoreapp2.0/designer/Avalonia.Designer.HostApp.dll if (!string.IsNullOrWhiteSpace(version)) { - string src = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + string? src = Environment.GetEnvironmentVariable("NUGET_PACKAGES"); + + if (string.IsNullOrEmpty(src)) + { + src = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + src = Path.Combine(src, ".nuget"); + src = Path.Combine(src, "packages"); + } - src = Path.Combine(src, ".nuget"); - src = Path.Combine(src, "packages"); src = Path.Combine(src, "avalonia"); src = Path.Combine(src, version); src = Path.Combine(src, "tools");