Skip to content

Commit 8bc3635

Browse files
committed
assembly resolution mechanism migrated to BHoM_Engine
1 parent 01966e2 commit 8bc3635

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

Excel_Adapter/ExcelAdapter.cs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
using System;
2828
using System.ComponentModel;
2929
using System.IO;
30+
using System.Linq;
3031
using System.Reflection;
3132
using System.Threading;
3233

@@ -43,8 +44,6 @@ public partial class ExcelAdapter : BHoMAdapter
4344
[Output("adapter", "Adapter to Excel.")]
4445
public ExcelAdapter(BH.oM.Adapter.FileSettings fileSettings = null)
4546
{
46-
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(PackagingAssemblyResolve);
47-
4847
if (fileSettings == null)
4948
{
5049
BH.Engine.Base.Compute.RecordError("Please set the File Settings to enable the Excel Adapter to work correctly.");
@@ -67,8 +66,6 @@ public ExcelAdapter(BH.oM.Adapter.FileSettings fileSettings = null)
6766
[Output("outputStream", "Defines the content of the new Excel file. This will be generated on a push and is not required for a pull.")]
6867
public ExcelAdapter(Stream inputStream, Stream outputStream = null)
6968
{
70-
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(PackagingAssemblyResolve);
71-
7269
if (inputStream == null)
7370
{
7471
BH.Engine.Base.Compute.RecordError("Please set the Stream for the template to enable the Excel Adapter to work correctly.");
@@ -80,24 +77,6 @@ public ExcelAdapter(Stream inputStream, Stream outputStream = null)
8077
}
8178

8279

83-
/***************************************************/
84-
/**** Private Methods ****/
85-
/***************************************************/
86-
87-
private Assembly PackagingAssemblyResolve(object sender, ResolveEventArgs args)
88-
{
89-
string[] split = args.Name.Split(',');
90-
if (split.Length > 1)
91-
{
92-
string assemblyPath = Path.Combine(BH.Engine.Base.Query.BHoMFolder(), $"{split[0]}.dll");
93-
if (File.Exists(assemblyPath))
94-
return Assembly.LoadFrom(assemblyPath);
95-
}
96-
97-
return null;
98-
}
99-
100-
10180
/***************************************************/
10281
/**** Override Methods ****/
10382
/***************************************************/

0 commit comments

Comments
 (0)