Microsoft.Bcl.Async .NET 4.0 Compatible with Excel DNA?

Aug 13, 2013 at 2:46 PM
Edited Aug 13, 2013 at 2:55 PM

As per title, the addin was being developed targeting 4.5 and async/await was used. However, realizing that Windows XP is still need to be supported, solution was changed to 4.0 with Microsoft.Bcl.Async install as workaround for async/await function.

When debugging directly from VS or running the .XLL, the customized ribbon/task pane is working fine. But when running from the packed XLL, nothing seems to be loaded (on 64 bit machine). When running from 32 bit machine, it complained "integration failed" error and quit loading.


What seems to be the cause of error? After renaming the dll to isolate error, it seems that System.Runtime and System.Threading.Tasks are not needed are the program went to do its job fine without them. Changing filename for Extensions.Desktop and Extensions make ExcelDNA complaints but still load the ribbon fine. Renaming the Threading.Tasks causes the ribbon to fail to load.

Here is the DNA file

<DnaLibrary RuntimeVersion="v4.0">
<ExternalLibrary Path="AssocsJceTemplate.dll" Pack="true" />
<ExternalLibrary Path="Analytics.NET.dll" Pack="true" />
<ExternalLibrary Path="Newtonsoft.Json.dll" Pack="true" />
<ExternalLibrary Path="Microsoft.Threading.Tasks.dll" Pack="true" />
<ExternalLibrary Path="Microsoft.Threading.Tasks.Extensions.Desktop.dll" Pack="true" />
<ExternalLibrary Path="Microsoft.Threading.Tasks.Extensions.dll" Pack="true" />
<ExternalLibrary Path="System.Runtime.dll" Pack="true" />
<ExternalLibrary Path="System.Threading.Tasks.dll" Pack="true" />
<customUI xmlns=''>
      <tab id='CustomTab' label='GAR'>
        <group id='SampleGroup' label='Template'>
          <button id='btnExport' imageMso='ChartShowData' label='ASSOCS JCE' size='large' onAction='ShowCustomTaskPane' />
        </group >
Aug 13, 2013 at 3:22 PM
Do you have an <add-in>.xll.config file? I thought the assembly redirects might be needed.

Maybe you could try to attach a debugger to the Excel before loading your packed add-in, and checking for any interesting output.

Else it would help if you posted a complete solution that exhibits the problem (loading normally but not when packed) - it would give me an easy start to look closer.

Aug 14, 2013 at 2:01 AM
Hi Govert,

No, I'm not using any XXX.xll.config. Sure, I can give you access to the repo. Can you send me your email address to me? Thank you.