views:

243

answers:

1

I've created a VSTO 2.0 SE add-in for Outlook 2007. Usually, it installs no problem on end-users' machines, but sometimes they have an outlook.exe.config file next to Outlook.exe which specifies that only .NET 1.0 or 1.1 is allowed to load. For example:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v1.0.3705" />
    <supportedRuntime version="v1.1.4322" />
  </startup>
</configuration>

In my test environment, if I add the 2.0 runtime to this list, then my add-in loads. IE:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v1.0.3705" />
    <supportedRuntime version="v1.1.4322" />
    <supportedRuntime version="v2.0.50727" />
  </startup>
</configuration>

Is there any issue with adding the last line automatically during installation? If there happens to be another add-in that is using the 1.1 runtime, will both add-ins be able to run side-by-side? Thanks!

+2  A: 

No, they can't run side-by-side. Whatever plug-in loads first will determine what version of the CLR will be loaded. Probably causing other plug-ins to fail.

This is fixed in .NET 4.0

Hans Passant
Ok, thanks. Simply deleting outlook.exe.config also seems to let my add-in load - is that a good approach or are there other implications to doing that?Also, when you say this is fixed in 4.0, does that mean a .NET 2.0 add-in, and a .NET 4.0 add-in can run side-by-side?
Joel
You should probably check if the .NET 1.x plug-ins still work properly. A .config file like that doesn't happen by accident. Yes, .NET 4.0 allows side-by-side execution.
Hans Passant