VSTO & .NET & Excel

July 31, 2008

VS 2008, COM Add-ins and launch conditions

Filed under: COM Add-ins — Dennis M Wallentin @ 11:49 am

I can create COM add-ins based on the Shared Add-in template in VS 2008 and they all work well on my developing computer. However, I got an issue when I tried to deploy them on configurations where only .NET Framework 2.0 is installed.

In the New Project dialog we can select the targeting .NET Framework version, 2.0 or 3.0 or 3.5. Since I needed to get the COM add-ins to work with version 2.0 I selected that version and then continued to work with the add-ins.

To test that they work with the targeting .NET Framework version I deployed them on configurations with Windows XP SP-3 where only version 2.0 of .NET Framework was installed. I also tried to deploy them on a Windows Vista SP-1 configuration with .NET Framework 3.0 but I got the same outcome as with Windows XP.

The outcome was the following:


I was rather surprised by this message so I started to try to locate the source but first I couldn’t find any errors at all. Finally I took a closer look on the setup packages. There I found out that it exist a launch condition for every setup. It’s not possible to remove it so what we can do is to change its condition.

The following screen shot shows the default setting (despite the fact that .NET Framework 2.0 was explicit selected in the first place). In the left window we can see the launch condition and in the right window its present setting of the property Version:

This was easily to change as the following screen shot shows: 

I then compiled the setup packages again and deployed them. This time everything worked as expected on all platforms.

Hopefully this can be useful for other developers. I hope that the upcoming SP-1 for VS 2008 will include a fix for it.

Kind regards,

July 26, 2008

VS 2008, Excel 2003 on Windows XP

Filed under: .NET & Excel, COM Add-ins — Dennis M Wallentin @ 1:18 pm

Recently I faced a situation where I created a managed COM add-in, based on the Shared Add-in template in VS 2008, which didn’t work at all. The configuration I work with is:

  • Windows XP with SP-3 
  • Office 2003 with SP-3
  • VS 2008

I had no issue to create the managed COM add-in but when I debugged it didn’t work as expected. All the entries in the Windows registry seemed to be OK but it didn’t show up in the dialog for COM add-ins in Excel 2003. In addition, no error messages appeared so it was a ‘silent’ error.

The solution to the issue is to install the KB908002 fix. However, if we run the exe package it first check to see if VS 2005 is installed or not. To overcome this process we need to decompile the exe package and then install the MSI package on its own.

I have made the MSI package available for download here.

Have anyone else experienced any issue with VS 2008?

Kind regards,

Create a free website or blog at WordPress.com.