protected override Assembly Load(AssemblyName assemblyName) { // CONSIDER: Should we consider priorities for packed vs local files? // First try the regular load path string assemblyPath = _resolver.ResolveAssemblyToPath(assemblyName); if (assemblyPath != null) { return(LoadFromAssemblyPath(assemblyPath)); } // Finally we try the AssemblyManager return(AssemblyManager.AssemblyResolve(assemblyName)); }
public static bool Initialize64(long xlAddInExportInfoAddress, long hModuleXll, string pathXll) { // NOTE: The sequence here is important - we install the AssemblyManage which can resolve packed assemblies // before calling LoadIntegration, which will be the first time we try to resolve ExcelDna.Integration AssemblyManager.Initialize((IntPtr)hModuleXll, pathXll); AppDomain.CurrentDomain.AssemblyResolve += (object sender, ResolveEventArgs args) => AssemblyManager.AssemblyResolve(new AssemblyName(args.Name)); return XlAddInInitialize((IntPtr)xlAddInExportInfoAddress, (IntPtr)hModuleXll, pathXll, AssemblyManager.GetResourceBytes, AssemblyManager.LoadFromAssemblyPath, AssemblyManager.LoadFromAssemblyBytes, Logger.SetIntegrationTraceSource); }