Different behavior between .NET framework 2.0 and 4.0

Aug 7, 2015 at 4:26 PM
We have a quite large project depending on Excel Dna as a backbone for integration with excel (thanks for Excel dna!).

So far we were using .NET 2.0 runtime. We now are ready to switch to the .NET 4.0, however we had come across some issues.
Unfortunatelly I was not able to reproduce the issue on my PC, so I cannot tell you the details as to why it happens.

What happens:
Under 2.0 Framework our users report no issues, everything works great. All we are doing is switching the .dna file and project setups to .NET 4.0. When I Open the Excel on my PC, everything works as usual, however some of my users have issues, main issue is connected to the Ribbon not showing up. I tried to catch exceptions however nothing is getting raised.

Basically when i give them 2 version of the Excel one targetted towards 2.0 everything works fine, the 4.0 version does not show ribbon - however UDFs registers properly so the load did happen.

I am now using the Office 2007, and everything works here.
The users that reported the issue are using the Office 2010 - i am not sure if thats the problem...

Any hints as to how to fix this?
Coordinator
Aug 7, 2015 at 5:40 PM
Check in Disabled Items, then try a tiny Ribbon example from the Excel-DNA Distribution.

Maybe some dependency is not loading, causing exceptions from the ribbon, and then Excel disables the COM part of the add-in.

-Govert

Aug 10, 2015 at 12:09 PM
Edited Aug 10, 2015 at 12:20 PM
Thanks for fast response,

Update:
We've tried the TinyRibbon example from your Samples, it worked for my client targeted towards the 4.0.

I asked my clients to look at the Add-Ins, it seems that the Com part of Add-In does not load at all, it does not appear as blocked either

Any advice?
The screens are from executing the same file. With same version of AddIn.

On My Pc - Image
On Clients Pc - Image
Coordinator
Aug 10, 2015 at 1:08 PM
Some error happens when loading your add-in under .NET 4.0 on that machine, probably some dependency that is in your GAC, or something to do with the Excel.exe.config file.

If there is a debugger on that machine, running Excel under the debugger might help.

Otherwise, enable Fusion logging, and look for problems there.

Otherwise, start from a simple add-in that works and grow it back to your add-in.

-Govert
Marked as answer by ntszar on 8/11/2015 at 3:03 AM
Aug 11, 2015 at 10:02 AM
It turned out to be issue like this:

http://stackoverflow.com/questions/15569664/system-missingmethodexception-int32-system-environment-get-currentmanagedthread

Basically we are compiling using the 4.5 Libraries, however our client only has 4.0...
I thought that the 4.5 is fully backwards compatible with the 4.0 .. Silly me.


Also, it turned out that we could just catch the exception, it seems that I made some mistake while trying to capture this earlier.


Thanks govert for your input! It lead to the discovery.