Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #148 from speckleworks/nic/load-assembly-improvement
Browse files Browse the repository at this point in the history
Moved a call to get types for a referenced assembly into the SafeLoad…
  • Loading branch information
teocomi authored Jun 12, 2020
2 parents 02059ec + 7896b8b commit 3d6eaf9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SpeckleCore/AssemblyCatalogue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ private IEnumerable<Assembly> LoadSpeckleReferencingAssemblies( IEnumerable<Asse
var assembly = SafeLoadAssembly( AppDomain.CurrentDomain, unloadedAssemblyName );
if ( assembly != null )
{
var res = assembly.GetTypes();
var copy = res;

assemblies.Add( assembly );
assemblies.Add(assembly);
}
}
}
Expand All @@ -117,7 +114,10 @@ private static Assembly SafeLoadAssembly( AppDomain domain, AssemblyName assembl
{
try
{
return domain.Load( assemblyName );
var assembly = domain.Load( assemblyName );
//Check that types can be loaded and there are no missing references etc
var res = assembly.GetTypes();
return assembly;
}
catch
{
Expand Down

0 comments on commit 3d6eaf9

Please sign in to comment.