Vladimir  Almaev
Vladimir Almaev

Reputation: 2358

Visual Studio 2015: Create VSTO project for Office 2010 and above that targets .NET 3.5

Is it possible to create VSTO project for Office 2010 and above that targets .NET 3.5 in Visual Studio 2015?

When I try to create it I don't see any project templates: 1

If I change version of .NET Framework to 4.0 or above then I can see project templates for Office 2010: 2

I have Windows 10 with activated .NET 3.5 feature, VS 2015 Enterprise.

Upvotes: 6

Views: 8167

Answers (3)

Wade Hatler
Wade Hatler

Reputation: 1835

I run into this all the time. I just set up a Windows 7 Virtual Machine with Visual Studio 2010 installed. When I need a new project, I make it on that VM, then copy the files over to my primary hard disk and open them in Visual Studio 2015 Community, which has to have the latest VSTO installed. It takes care of any upgrades necessary (usually), and then do all my work there. I've got Visual Studio 2010 Pro on the Virtual Machine. I'm not sure if you can do it with the free Express version or not.

I always target .NET 4.0 in my projects. Haven't targeted 3.5 in a long time so I don't know if VSTO will work with it or not. I wouldn't be surprised to find you just have to change the .NET version requirement in your Project file and it works, but also wouldn't be surprised if it failed. .NET 3.5 to 4 is a simple and very low risk upgrade, so if you can't get VSTO to work with 3.5, I'd recommend adding a .NET installer to your installer.

Upvotes: 0

Vladimir  Almaev
Vladimir Almaev

Reputation: 2358

MSDN says that we cannot develop VSTO Addins that targets .NET 3.5 since Visual Studio 2012: 1

For more information, please, see "Visual Studio Tools for Office Runtime Installation Scenarios":

Upvotes: 1

Eugene Astafiev
Eugene Astafiev

Reputation: 49455

VSTO allows creating version specific add-ins. Typically each VSTO version supports only two Office versions. I suppose the latest version supports only Office 2013 and Office 2016. That's why you don't see templates for Office 2010. You need to install an old VS version if you need to create a project for Office 2010.

Note, you can run solutions created in VS2015 in previous Office versions. See Running Solutions in Different Versions of Microsoft Office for more information.

Upvotes: 0

Related Questions