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


Guest


Hi

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
sumu
Posted 21 Sep, 2010 20:37:21 Top
Eugene Astafiev


Guest


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"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

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.
Posted 22 Sep, 2010 04:00:52 Top