简体   繁体   中英

It is possible to target .NET framework 3.5 or .NET framework 3.5 client profile when creating an Add-in for Outlook 2010

I have an add-in for Outlook 2010, created with Visual Studio 2010 and using VSTO. The projects target framework is .NET framework 4 Client Profile (as default).

Is there any way to change the target framework to .NET framework 3.5 or .NET framework 3.5 profile for my project? The project itself doesn't allow me to make the change and reverts back to .NET 4, when using the project Properties -> Application tab.

在此处输入图像描述

I am aware that I may need to make changes to my code, in order for it compile for .NET Framework 3.5.

Best regards

MLJ

Because a new VSTO project references the correct versions of the Office.Tools assemblies for that .net framework I don't recommend changing the target framework version like that.

In the past I have simply created a new project, then added all my code to the new add-in. This ensures you have the correct versions of the VSTO Tools referenced, and the correct setup for that version of the .net framework.

At a minimum create a new project, then edit your old.csproj file, copy the Office.Tools.* references from the new.csproj file into your old one, and try to manually modify the old.csproj file to match the new one. Multi-targeting is not as nice a story with VSTO as other project types:)

Project Properties / Application

There's a target framework option there.

In Visual Studio, right click the project, click Properties. On the Application tab, there is a Target Framework dropdown. Change this to the version you require.

在此处输入图像描述

Once you change the target framework, check for any compiler errors. Providing you haven't used any of the.Net 4 specific functionality, you should be able to just recompile and be done.

Edit

Re-reading your question, it looks as though you're asking specifically whether you can develop Outlook 2010 VSTO addins using.Net 3.5.

As far as I can tell, yes, you can, so long as you use only Office Runtime 3.5 Extensions functionality.

This may be of help: http://msdn.microsoft.com/en-us/library/bb608603.aspx

But I should ask - why do you wish to drop down to 3.5? Judging by the information in this post here , you should try and stick with 4.0.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM