You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the project option to make an output 'publish' directory with a completely-unpacked add-in, the add-in we get in the output folder does not work anymore. The -AddIn64.xll here does not contain the packed ExcelDna.* assemblies, but they are not present in this directory either. When starting to debug, we get
One option is to copy back the ExcelDna.*.dll files from the publish directory
<TargetName="PostBuild"AfterTargets="PostBuildEvent">
<!-- Copy all ExcelDna.*.dll files back to the output directory -->
<ExecCommand="xcopy "$(OutputPath)publish\ExcelDna.*.dll""$(OutputPath)" /Y /I /S" />
</Target>
But then opening the add-in without the debugger crashes Excel, and with the debugger we get this unhandled exception in the loading
The culprit in this case (which makes the output directory different to the publish directory) is the presence of an <MyProject>-AddIn64.deps.json file. This file does not list the extra ExcelDna.Loader.dll, and this causes the load to fail for some reason (it would be nice to know why). This seems to have changed in Excel-DNA version 1.7.0 (and is reported to still have worked in 1.6.0, I haven't checked).
By deleting the <MyProject>-AddIn64.deps.json file we get an output directory that can be debugged.
This can be done in another project task:
<TargetName="PostBuild"AfterTargets="PostBuildEvent">
<!-- Copy all ExcelDna.*.dll files back to the output directory -->
<ExecCommand="xcopy "$(OutputPath)publish\ExcelDna.*.dll""$(OutputPath)" /Y /I /S" />
<!-- Delete <ProjectName>-AddIn64.deps.json from the output directory -->
<MessageText="Deleting $(OutputPath)$(MSBuildProjectName)-AddIn64.deps.json"Importance="high" />
<ExecCommand="del /Q "$(OutputPath)$(MSBuildProjectName)-AddIn64.deps.json"" />
<!-- Delete <ProjectName>-AddIn.deps.json from the output directory -->
<MessageText="Deleting $(OutputPath)$(MSBuildProjectName)-AddIn.deps.json"Importance="high" />
<ExecCommand="del /Q "$(OutputPath)$(MSBuildProjectName)-AddIn.deps.json"" />
</Target>
It is possible to edit the .deps.json file to add the ExcelDna.Loader.dll but that doesn't seem like a practical approach:
With the project option to make an output 'publish' directory with a completely-unpacked add-in, the add-in we get in the output folder does not work anymore. The
-AddIn64.xll
here does not contain the packed ExcelDna.* assemblies, but they are not present in this directory either. When starting to debug, we getOne option is to copy back the ExcelDna.*.dll files from the publish directory
But then opening the add-in without the debugger crashes Excel, and with the debugger we get this unhandled exception in the loading
The culprit in this case (which makes the output directory different to the publish directory) is the presence of an
<MyProject>-AddIn64.deps.json
file. This file does not list the extra ExcelDna.Loader.dll, and this causes the load to fail for some reason (it would be nice to know why). This seems to have changed in Excel-DNA version 1.7.0 (and is reported to still have worked in 1.6.0, I haven't checked).By deleting the
<MyProject>-AddIn64.deps.json
file we get an output directory that can be debugged.This can be done in another project task:
It is possible to edit the .deps.json file to add the
ExcelDna.Loader.dll
but that doesn't seem like a practical approach:The text was updated successfully, but these errors were encountered: