Yes, I have had a look at the files you sent. I sent the reply below directly, but I repeat it here if it might be of interest to others.
I also attach a sample .dna file that shows how you could load and unload another add-in.
----
There were some changes that I made after the v 0.29 release to allow the references to resolve correctly if the library has been loaded 'from bytes' already. Without that, I think the libraries that are referenced from ExternalLibrary loaded .dlls will either have to be resolved from the same directory by the .NET loader, locking the file,
If I built the solution, then look in the ExcelDnaDemoXll\bin\Debug directory I see the .xll, .dna and three .dlls. But we don't want the .NET loader to resolve the ExcelDnaDemoCore.dll from that directory, so I first delete both ExcelDnaDemoCore.dll and ExcelDnaDemoLib.dll from the ExcelDnaDemoXll\bin\Debug directory. (You can set Copy Local=false for both of the references in the ExcelDnaDemoXll project too.)
Now I load the .xll in Excel. Both functions work and I am able to delete or change any of the three .dlls.
[An alternative to LoadFromBytes='true', and I can't quite tell the difference now, is to set ShadowCopyFiles="true" in the .dna file:
<DnaLibrary RuntimeVersion="v4.0" ShadowCopyFiles="true">
This also ensures that the .dll files won't be locked]
But I see there is a problem that reloading (via File->Open) the add-in does not reload the code. The new code does not get loaded because the assembly has already been resolved in the AppDomain.
One way around this is to use the add-ins dialog (press Alt+t then i) to load and unload the add-in every time.
You can also unload the add-in and reload from another add-in. I attach a .dna file with some code to load / unload as a start.
It's not so easy with the normal File->Open to completely recycle the AppDomain. I'd have to move some stuff to the unmanaged part, which is always tricky.
So for now I suggest you try either with the Alt+t, i add-ins dialog or having a separate meta-addin to help with the unloading.
Let me know whether you agree with the above.
Regards,
Govert
> --
> You received this message because you are subscribed to the Google Groups
> "Excel-DNA" group.
> To post to this group, send email to exce...@googlegroups.com.
> To unsubscribe from this group, send email to
> exceldna+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/exceldna?hl=en.
>
>
>
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 7050 (20120413) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>