From 6b5d11f49e05fb67ee04be127270fd19cd2a9770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20D=C3=A9ri?= Date: Fri, 24 Jan 2025 15:54:29 +0100 Subject: [PATCH 1/7] loading pyRevitLabs.json manually if assembly is not found --- dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs b/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs index 0ece364cc..ac05dfb53 100644 --- a/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs +++ b/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs @@ -89,6 +89,18 @@ public static string CLIInfoVersion { // cli entry point: static void Main(string[] args) { + AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => + { + if (args.Name.Contains("Newtonsoft.Json")) + { + var assemblyPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "pyRevitLabs.Json.dll"); + if (File.Exists(assemblyPath)) + { + return Assembly.LoadFrom(assemblyPath); + } + } + return null; + }; // process arguments for logging level var argsList = new List(args); From 312493592f5956e369fccb497a044b95bc6cc8f8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Couffin Date: Fri, 24 Jan 2025 16:03:08 +0100 Subject: [PATCH 2/7] Update dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs Co-authored-by: devloai[bot] <168258904+devloai[bot]@users.noreply.github.com> --- dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs b/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs index ac05dfb53..6d6569b1c 100644 --- a/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs +++ b/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs @@ -91,7 +91,7 @@ public static string CLIInfoVersion { static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => { - if (args.Name.Contains("Newtonsoft.Json")) + if (args.Name.StartsWith("Newtonsoft.Json,")) { var assemblyPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "pyRevitLabs.Json.dll"); if (File.Exists(assemblyPath)) From 6d0b9805aedc6a734bb9f47892ce5e5bb76eadd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20D=C3=A9ri?= Date: Fri, 24 Jan 2025 16:03:56 +0100 Subject: [PATCH 3/7] less strict python version requirement to allow newer versions --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 289af0eb9..095dd9f63 100644 --- a/Pipfile +++ b/Pipfile @@ -26,7 +26,7 @@ mkdocs-material = "*" ruff = "*" [requires] -python_version = "3.10" +python_version = ">=3.10" [pipenv] allow_prereleases = true From 0069b0287f6246258594f0e56b87c4659c2ea72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20D=C3=A9ri?= Date: Fri, 24 Jan 2025 16:13:35 +0100 Subject: [PATCH 4/7] some logging --- dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs b/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs index ac05dfb53..5d3a99c1f 100644 --- a/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs +++ b/dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs @@ -94,9 +94,12 @@ static void Main(string[] args) { if (args.Name.Contains("Newtonsoft.Json")) { var assemblyPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "pyRevitLabs.Json.dll"); + logger.Debug($"Looking for Newtonsoft.Json assembly at: {assemblyPath}"); if (File.Exists(assemblyPath)) { - return Assembly.LoadFrom(assemblyPath); + var assembly = Assembly.LoadFrom(assemblyPath); + logger.Debug($"Successfully loaded Newtonsoft.Json assembly from: {assemblyPath}"); + return assembly; } } return null; From 81834014a1a050748a6b21402115c8672b060897 Mon Sep 17 00:00:00 2001 From: Jean-Marc Couffin Date: Fri, 24 Jan 2025 16:28:55 +0100 Subject: [PATCH 5/7] Update dev-guide.md --- docs/dev-guide.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/dev-guide.md b/docs/dev-guide.md index 2faa47754..2d86176e0 100644 --- a/docs/dev-guide.md +++ b/docs/dev-guide.md @@ -22,6 +22,7 @@ Install Visual Studio 2022 and select: - .NET Framework 4.7.2 Targeting Pack - .NET Framework 4.8 SDK - .NET Framework 4.8 Targeting Pack + - .NET 3.1 Runtime (MahApps.Metro) - NuGet package manager - MSBuild From 390ba3dcb37a32afb7df4ed64ed2eff0a2d62cd4 Mon Sep 17 00:00:00 2001 From: Jean-Marc Couffin Date: Fri, 24 Jan 2025 16:37:21 +0100 Subject: [PATCH 6/7] Update Pipfile --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 095dd9f63..9295cb295 100644 --- a/Pipfile +++ b/Pipfile @@ -26,7 +26,7 @@ mkdocs-material = "*" ruff = "*" [requires] -python_version = ">=3.10" +python_version = "=3.10" [pipenv] allow_prereleases = true From e70ba0bb262ac18b31421dc5a45bbe9ff08368d7 Mon Sep 17 00:00:00 2001 From: Jean-Marc Couffin Date: Fri, 24 Jan 2025 16:40:03 +0100 Subject: [PATCH 7/7] Update Pipfile --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 9295cb295..289af0eb9 100644 --- a/Pipfile +++ b/Pipfile @@ -26,7 +26,7 @@ mkdocs-material = "*" ruff = "*" [requires] -python_version = "=3.10" +python_version = "3.10" [pipenv] allow_prereleases = true