When launching the .xll file for a minimal ExcelDNA add-in targeting .NET Framework 4.8, certain users see the following error:
A problem occurred while the add-in was creating an isolated application domain and loading required assemblies.
AppDomain could not be created
Many other users do not encounter this error. If we build the add-in for .NET 6, the affected users do not get the error. The add-in uses ExcelDna v1.7.0-rc6.
In the ExcelDNA source code, this error is raised by ExcelDnaLoader.cpp in two cases:
- Failure to get current AppDomain using
ICorRuntimeHost::CurrentDomain, and - Failure to create new AppDomain using
ICorRuntimeHost::CreateDomainEx
(I note that ICorRuntimeHost appears in the docs under "Deprecated CLR hosting interfaces" )
What have we tried?
- the HRESULT 0x7DAEF100 doesn't appear to match any known value
- we haven't yet identified any characteristic of the affected users' machines which might explain why they hit this error but others don't. The Windows version and build doesn't seem to be the cause, for example
- we don't see any related events in Event Viewer
Given the deprecated technologies, I'm not hopeful about finding a solution (besides upgrading our add-in to .NET 6). But, here goes.
How might we go about debugging this further?
What are the possible causes of failure in ICorRuntimeHost::CurrentDomain and ICorRuntimeHost::CreateDomainEx?
