Skip to content

Commit 0737022

Browse files
Add a workaround for definition error on iTextSharp-LGPL package: assembly name is lowercase while filename is CamelCase which causes the error: (#603)
System.IO.FileNotFoundException: Could not load file or assembly 'itextsharp, Version=4.1.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' on linux.
1 parent b36bc4e commit 0737022

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ public static CultureInfo GetCultureForLang(string lang)
418418

419419
const string ConfigurationManagerBak = "System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51";
420420
const string ConfigurationManagerFileName = "System.Configuration.ConfigurationManager.dll";
421+
422+
const string ITextSharpFileName = "iTextSharp.dll";
423+
const string ITextSharpAssemblyName = "itextsharp";
421424
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
422425
{
423426
var requestedAssembly = new AssemblyName(args.Name);
@@ -434,7 +437,16 @@ private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEven
434437
return Assembly.LoadFrom(fileName);
435438
}
436439
}
437-
else {
440+
else if (args.Name.StartsWith(ITextSharpAssemblyName))
441+
{
442+
string fileName = Path.Combine(FileUtil.GetStartupDirectory(), ITextSharpFileName);
443+
if (File.Exists(fileName))
444+
{
445+
return Assembly.LoadFrom(fileName);
446+
}
447+
}
448+
else
449+
{
438450
AssemblyName assName = new AssemblyName(args.Name);
439451
bool strongNamedAssembly = assName.GetPublicKeyToken().Length > 0;
440452
string fileName = Path.Combine(FileUtil.GetStartupDirectory(), $"{assName.Name}.dll");

0 commit comments

Comments
 (0)