Skip to content

Fix Problem With Installer AddinManager

Chuong Ho edited this page May 29, 2023 · 8 revisions

Problem when user delete some dll in directory and want restore

Solution :

  • Download last version at Release Last
  • Open again file msi and click repair

RepairRemoveAddin

Problem with load some assembly dependent

  • Let add this when you load command. With application, you can create a function and push it to startup.
string assPath = Assembly.GetExecutingAssembly().Location;
string? dirPath = Path.GetDirectoryName(Path.GetFullPath(assPath)) ?? null;
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
{
    var assemblyName = new AssemblyName(args.Name);
    if (!string.IsNullOrEmpty(dirPath))
    {
        var assemblyPath = Path.Combine(dirPath, assemblyName.Name + ".dll");
        if (File.Exists(assemblyPath) == false) return null;
        var assembly = Assembly.LoadFrom(assemblyPath);
        return assembly;
    }
    return null;
};