Hi Lucas,
While we fixed the worst error when reloading, we’ve not incorporated the function re-registration for version 1.6.
This would involve changing (or duplicating) the managed code that is shared by .NET Framework and .NET 6, and I wasn’t comfortable doing that at this stage – I want the .NET Framework version at runtime to be as stable for this version as possible. So the behaviour you report is ‘expected’ and the add-in reloading support is still planned for after version 1.6.
However, some work in this direction has been done, and you might want to rebuild and try out from the ReloadNET6 branch: Excel-DNA/ExcelDna at ReloadNET6 (github.com)
Otherwise you’ll have to wait a bit longer. Unfortunately under .NET 6 this whole story will be much harder, so I can’t tell whether or when we’ll have good reload support under .NET 6. Even for .NET Framework, the support is quite limited.
-Govert
From: exce...@googlegroups.com <exce...@googlegroups.com> On Behalf Of Lucas Dias
Sent: 28 September 2022 22:40
To: Excel-DNA <exce...@googlegroups.com>
Subject: [ExcelDna] Re: Error reloading add-in
Hi Govert,
I'm trying to get hot-reloading to work on .NET 6 using the latest version (1.6.0-rc1), where the host.cpp problems seem to be fixed. I'm able to re-register the XLL (through drag and drop), which shows the pop-up below. However, the function body/behavior doesn't change. Is this expected?
Thanks in advance!
I already tried to reload in 4 ways:
- File -> Open the .xll
- From VBA, Application.RegisterXLL...
- From another XLL addin, run ExcelAsyncUtil.QueueAsMacro ... ExcelIntegration.RegisterXLL ...
- Addins(...).Installed = False then Installed = True (doesn't give an error, but the functions disappear).
All lead to the same error.
Version: Fresh .NET 6 project, ExcelDNA 1.6.0-preview3, target net6.0-windows.
Any clues?
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/0b1818a6-e748-4cad-b1ee-fb2c4f17d018n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Excel-DNA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/exceldna/zuKNQu-7q5s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/de825ebb-832e-4b51-8524-39fdb407960fn%40googlegroups.com.
Debugging the “AssemblyLoadContext” unloading is quite a rabbit hole to go down - How to use and debug assembly unloadability in .NET | Microsoft Learn
I think a good start would be to make a minimal add-in that doesn’t work.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/CAMsj2cCB-SiwoObzGPt%2B3GBQwE0G2CmCH70YBMECo4NG5%3DHSyQ%40mail.gmail.com.
That error should not be fatal – we’re just checking whether we can write to the machine hive, and the exception tells us we can’t.
In that case we’ll back down and write to the user hive.
Reloading when you’re using a COM Server is a hard case that we never dealt with in .NET Framework.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/f450c389-8c67-4cc2-b646-946573f79538n%40googlegroups.com.