From 162c9115c692d91358c0adfe8dd415c375cb02a6 Mon Sep 17 00:00:00 2001 From: Claudia Murialdo Date: Thu, 2 Jun 2022 13:56:58 -0300 Subject: [PATCH] Add a workaround for definition error on iTextSharp-LGPL package: assembly name is lowercase while filename is CamelCase which causes the error: System.IO.FileNotFoundException: Could not load file or assembly 'itextsharp, Version=4.1.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' on linux. --- .../src/dotnetframework/GxClasses/Core/gxconfig.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs b/dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs index 47a21df2c..622b742d0 100644 --- a/dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs +++ b/dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs @@ -418,6 +418,9 @@ public static CultureInfo GetCultureForLang(string lang) const string ConfigurationManagerBak = "System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"; const string ConfigurationManagerFileName = "System.Configuration.ConfigurationManager.dll"; + + const string ITextSharpFileName = "iTextSharp.dll"; + const string ITextSharpAssemblyName = "itextsharp"; private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { var requestedAssembly = new AssemblyName(args.Name); @@ -434,7 +437,16 @@ private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEven return Assembly.LoadFrom(fileName); } } - else { + else if (args.Name.StartsWith(ITextSharpAssemblyName)) + { + string fileName = Path.Combine(FileUtil.GetStartupDirectory(), ITextSharpFileName); + if (File.Exists(fileName)) + { + return Assembly.LoadFrom(fileName); + } + } + else + { AssemblyName assName = new AssemblyName(args.Name); bool strongNamedAssembly = assName.GetPublicKeyToken().Length > 0; string fileName = Path.Combine(FileUtil.GetStartupDirectory(), $"{assName.Name}.dll");