targeting .net 3.5 in ADX2010

Add-in Express™ Support Service
That's what is more important than anything else

targeting .net 3.5 in ADX2010
targeting .net 3.5 (sorry for reposting. Posted in the wrong forum before) 
sumu kalshan

Posts: 24
Joined: 2009-11-16

I am currently on VS2010 with ADX2010 for .net

I am using a .net 2.0 precompiled 3rd party dll along with ADX for writing a Excel COM addin

Now, all the usual tricks for mixed mode assembly don't work because excel's config has to be changed for legacyv2runtime, which I am very hesitant to do
I think you suggest this as well using the Host Configuration Command

However I can get things to work by targeting the ADX com addin to .net 3.5. It compiles properly and seems to run well.
Do you advise against doing this or is it ok to do this? Will it cause any problems in advanced features?

Thanks in advance
Posted 21 Sep, 2010 20:37:21 Top
Eugene Astafiev

Add-in Express team

Posts: 8540
Joined: 2007-07-25
Hi Sumu,

Please note that .net framework 3.5 uses CLR 2.0. Contrariwise, .net framework 4.0 uses its own CLR 4.0. In that case you can:

1. Create a config file (or modify an existing one) for the host application (for example, Outlook). Name it Outlook.exe.config and place it in the same folder where Outlook.exe resides. Typically, for Outlook 2007, it is the C:\Program Files\Microsoft Office\Office12 folder. Please use the following content for the config file:

<?xml version="1.0"?>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

2. Change the target framework of your add-in project to .net framework 3.5 or lower. It should use CLR 2.0.

Both solutions have its own pros and cons. The simplest one is to re-target the add-in project.
.NET, Extended MAPI, Windows Phone & RT
Posted 22 Sep, 2010 04:00:52 Top