views:

1056

answers:

2

I have created an Excel 2003 add-in that uses the CLR 2.0 and this add-in is to be installed in hundreds of machines at my customer's site. The issue is that some of the machines where the add-in is installed have .NET 1.1 and .NET 2.0 running side by side, and the plugin throws an error when it's trying to load.

The solution I have come across that works is to create an excel.exe.config file in the same folder where excel.exe is that sets the supportedRuntime version to v2.0.50727.

Because this solution does not scale well in my case (since the add-in is to be used in hundreds of machines where the users might not even have access to create a config file), I was wondering if I could add the same supportedRuntime parameter in my plugin app.config file and it would work.

If this will not work, do you guys know of anything else I could try?

A: 

Well, if there are hundreds of machines I assume there is Group Policy in place or some other method of running admin scripts or setup files. Maybe you can create a small MSI package to push out this config file or get it added to a startup script?

JD Conley
I thought about this, but I would like to leave it as a last option if nothing else comes up.
+1  A: 

What is the error message that you receive?

The problem that you describe should not occur with Office 2007. However, it is a known problem for so-called Shared Add-ins (.NET add-ins based on the Extensibility.IDTExtensibility2 interface using COM interoperability) in Office 2003.

Microsoft has a released a patch, which should be installed for every user using the add-in. You can obtain the patch here:

http://support.microsoft.com/kb/908002

The solution using the config file is a non-standard solution but should also fix the problem as stated in the following article:

http://nielsvanvliet.com/excel.html#Patch

If want to deploy your add-in using an MSI installer you should check the Shared Add-in Support Update for the Microsoft .NET Framework 2.0 (KB908002) as a pre-requisite in the properties of the setup project. Please note that this fix can only be installed for the current user, i.e. an ALLUSERS setup should be disabled.

UPDATE: The installation with VS 2008 is a little more complicated. See here:

http://stackoverflow.com/questions/553794/can-a-net-word-2003-add-in-be-installed-outside-of-the-gac/553886#553886

0xA3
Unfortunately, I don't have access to windows machine with VS and Excel right now to tell you the specific error. But I am pretty sure the error is related to the fact that Excel is loading CRL 1.1 instead of the CLR 2.0.
And you are sure that the problem is with Office 2007 and not 2003? I haven't seen such a problem with Office 2007. What kind of add-in did you develop (VSTO version x, shared add-in (IDTExtensibility)?
0xA3
I don't think I explained the issue correctly. The error is in Excel 2003 since even though .NET 2.0 is installed, it defaults to .NET 1.1. I am using a tool called add-in-express for VS 2005, and I am pretty sure - though not 100% sure - this tool does use the IDTExtensiblity interface.
Since it is Excel 2003 your problem is the know problem fixed by KB908002.
0xA3