-1

I have a windows application that uses Excel-Addin using Excel DNA and targets CLR 2.0 and works fine with Office Excel up to Office 2013 64 bit, but we have found that when deploying to a machine with Office 2016 64 bit, Excel DNA complains that it cannot find a CLR 4.0 installation and so aborts the installation.

Without creating 2 instances of the project one that targets CLR 2.0 and the other one CLR 4.0 due to features and fixes this will become a maintenance nightmare.

Is there any way to create one version of the project where Excel DNA will target the appropriate CLR.

SteveO
  • 1

1 Answers1

0

Excel-DNA only supports the 64-bit Excel if your add-in targets .NET 4.0.

.NET 4.0 should be the 'appropriate' version of the runtime in all cases - it has been the current .NET version for over 6 years, and is the only version installed by default on current versions of Windows.

You have some options:

  • Upgrade your add-in to always target .NET 4.0. For most add-in, this is as simple as editing the .dna file. The .NET runtime has great backward compatibility, so this usually just works.

  • Have separate .dna files for the 32-bit and 64-bit versions. This will take some work to set up in your project configuration or build process (unless you're using the new v 0.34 beta version's build targets). But then you'd still be targeting .NET 2.0 for 32-bit Excel.

Govert
  • 16,387
  • 4
  • 60
  • 70
  • just to be sure: if the add-in supports .NET 4.0, then it is better to use a single .dna file to generate both 32-bit and 64-bit versions, correct? – Romain Hautefeuille Feb 27 '17 at 22:25
  • looking at the code of ExcelDnaPack.exe, the .dna filename is used to choose which .xll to pack, so I guess this is a "good" reason to use distinct .dna files :) – Romain Hautefeuille Feb 27 '17 at 23:22