You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
675 B
C#

using System.Reflection;
namespace DS.Module.Core.Helpers;
public static class ReflectHelper
{
public static Assembly[] GetAssemblies()
{
Assembly[] assemblies = null;
#if NET45
if (System.Web.Hosting.HostingEnvironment.IsHosted)
{
assemblies = System.Web.Compilation.BuildManager.GetReferencedAssemblies()
.Cast<Assembly>().ToArray();
}
#endif
if (null == assemblies || assemblies.Length == 0)
{
assemblies = AppDomain.CurrentDomain.GetAssemblies();
}
return assemblies ?? ArrayHelper.Empty<Assembly>();
}
}