Search code examples
c#excel-dna

How can I avoid Excel-DNA add-in from locking external library dlls?


I was building an Excel-DNA add-in with an auto update feature, as per @Govert's suggestion on another stack overflow question I used parts of the add-in reloaded sample to reload the add-in when a specific flag file is overwritten after copying the updated add-in files, This all works great but some of the dlls that are loaded as external libraries on the reloaded add-in are locked by excel how can I load them so that they won't be locked?

I have tried setting the loadfrombytes flag to true on the dna file.

Both the reloaded and the reloaded add-ins main dlls are not being locked, only external libraries I added to the reloaded add-in are locked one example is log4net.dll.

I am also not packing my add-in.

Thanks.


Solution

  • Reloading of Excel-DNA add-ins without restarting Excel is currently limited to:

    • Add-ins that don't use any of the COM features (e.g. Ribbon, CTP, RTD, etc.)
    • Add-ins that don't reference any other assemblies

    You can request improvements to this feature by opening an issue in the main repository: https://github.com/Excel-DNA/ExcelDna