Skip to content

Commit 01966e2

Browse files
committed
assembly resolution fix loosened to concern any failing dll
1 parent c165171 commit 01966e2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Excel_Adapter/ExcelAdapter.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ public ExcelAdapter(Stream inputStream, Stream outputStream = null)
8686

8787
private Assembly PackagingAssemblyResolve(object sender, ResolveEventArgs args)
8888
{
89-
if (args.Name.StartsWith("System.IO.Packaging,"))
89+
string[] split = args.Name.Split(',');
90+
if (split.Length > 1)
9091
{
91-
string assemblyPath = Path.Combine(BH.Engine.Base.Query.BHoMFolder(), "System.IO.Packaging.dll");
92-
return Assembly.LoadFrom(assemblyPath);
92+
string assemblyPath = Path.Combine(BH.Engine.Base.Query.BHoMFolder(), $"{split[0]}.dll");
93+
if (File.Exists(assemblyPath))
94+
return Assembly.LoadFrom(assemblyPath);
9395
}
9496

9597
return null;

0 commit comments

Comments
 (0)