Deployment options for .Net 6 ExcelDna AddIn #607
-
Hi there, I tried running my .Net 6 ExcelDna Addin on a machine without .net 6 installed and unsurprisingly I get the error message below. Is there a way to publish such that the xll is self contained, and does not have any .net runtime prerequisites? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We don't support the bring-your-own-runtime option of .NET Core, because the add-in isolation mechanism we use (the AssemblyLoadContext etc.) doesn't support that. Because only one version of a .NET Core runtime can be loaded into the Excel process (in addition to the .NET Framework runtime) separate add-ins can't bring their own version of the .NET 6 runtime. So you need a .NET 6 runtime installed on the machine before your add-in can load. This installation does not need admin permissions to do and can be in a directory related to your add-in. You could make an installer for your add-in that adds the .NET 6 runtime as a prerequisite, for example based on the WixInstaller template here https://github.com/Excel-DNA/WiXInstaller or the updated test version here https://github.com/govert/Test-WiXInstaller. I doesn't have the .NET 6 dependency at the moment, but I guess that would be a standard thing to add to a WiX project. In a future version of .NET we might try to support the NativeAOT compilation more of .NET, and then you would not need a runtime installation at all. But there will be limitations on the supported features. This works is still a while away though, and will depend on whether we continue to get generous users signing up as GitHub Sponsors to support further development. |
Beta Was this translation helpful? Give feedback.
We don't support the bring-your-own-runtime option of .NET Core, because the add-in isolation mechanism we use (the AssemblyLoadContext etc.) doesn't support that. Because only one version of a .NET Core runtime can be loaded into the Excel process (in addition to the .NET Framework runtime) separate add-ins can't bring their own version of the .NET 6 runtime. So you need a .NET 6 runtime installed on the machine before your add-in can load. This installation does not need admin permissions to do and can be in a directory related to your add-in.
You could make an installer for your add-in that adds the .NET 6 runtime as a prerequisite, for example based on the WixInstaller template here h…