Add in: Outlook versions and .net framework RRS feed

  • Question

  • Hello together,

    I am continuing development of an outlook addin created with VS2012, targeting .net framework 4. This has been running fine with Outlook 2007 on a Windows 7 Plattform. Recent requirements made it so that the addin has to work with Outlook 2007,2010 and also 2013.

    I have been discussing with a collegue of mine wich framework version to target, but VS wont let me target any framework version below 4.0.  So the question is, does Office 2007 come with any Visual Studio tools for office runtime? Is it possible to just target version 4.0 and have it work automaticially?

    Lets say we have a workstation with only .net 2.0 installed. If the user installs Office 2007 and then the addin (which was targeted 4.0), would this addin run?

    Thanks for reading this rather noobish questions.

    Greetings, Florian

    EDIT: And i just created this topic in the wrong forum. Sorry for this, could a moderator please move this to the right subforum? Thank you.
    • Edited by chilltax Wednesday, January 23, 2013 4:12 PM
    • Moved by Ego Jiang Thursday, January 24, 2013 7:44 AM
    Wednesday, January 23, 2013 4:00 PM


  • yes, either go back to vs2010 and create/maintain setup project or for vs2012 install installshield LE that also supports checking for prerequisties (or use any other technology that suits you)
    • Marked as answer by chilltax Friday, January 25, 2013 1:17 PM
    Friday, January 25, 2013 11:53 AM

All replies

  • Hi,

    First, Visual Studio 2012 can target .NET Framework 2.0, 3.0, 3.5, 4 and 4.5. You just need to install the .NET Framework versions that are missing using the <More Frameworks...> item in the combobox of the New Project dialog where you select the .NET Framework, because low versions are not installed by VS 2012.


    If you target .NET Framework 2.0 (sacrificing features of higher versions such as LINQ, WPF,  Embedded Interop, etc.), your add-in will work with .NET Framework 2.0 or higher.

    But if you target .NET Framework 4.0, it won't work on workstations with .NET Framework 2.0, 3.0 and 3.5.

    About supporting multiple Outlook versions, I am not expert in this area, but I think that if you target Outlook 2007 references, it should work with higher versions with the same add-in assembly, but not the opposite (referencing Outlook 2013 assemblies). Another approach is to have 3 projects with the proper references for each Outlook version, sharing all the code files with maybe conditional compilation.

    MZ-Tools: Productivity add-ins for Visual Studio: My blog about developing add-ins:

    Wednesday, January 23, 2013 5:31 PM
  • Thank you for your answer Carlos!

    I allready tried adding the missing Frameworks and selecting them as target. VS tells me that this project type does not support this version of the framework. This persists for 2.0, 3.0 and also 3.5. If i try to create a new VSTO project and select a version < 4.0 in the new-project-wizard, the list wont display VSTO as a possible project for this version.

    Currently my addin references the Office Tools v4.0 Framework. I stumbled upon a article mentioning that Office 2007 comes with the Visual Studio Tools 3.0 on board. Does Office itself install any .NET Framwork version? Can someone clear me up on this one?

    Thursday, January 24, 2013 8:27 AM
  • VS 2012 only supports writing add-ins for office 2010 and higher. You should still manage to run add-in on office 2007 system _if_ there is .net 4.0 installled and vstor 2010 and you are careful enough to not use outlook types introduced in later versions. But i guess it will be tricky so my advice - stick with VS 2010 which supports writing office 2007 plugins for .net 3.5 and that plugin will work on both office 2010 and 2013.
    Thursday, January 24, 2013 8:33 AM
  • Thanks Damian,

    Does office 2007 itself install .net 3.5? Or would we have to make sure that every system the addin has to run on has 3.5 installed?

    Thursday, January 24, 2013 9:12 AM
  • latter
    Thursday, January 24, 2013 11:20 AM
  • I tried to test the addin on a Windows XP SP3 machine with office 2007 installed, no .NET at that point. The addin was compiled for "Any CPU" and also for x86 specificially. Both test runs resulted in a error message:

    "[path]/setup.exe is not a valid win32 application"

    I tried to test without any .NET Framework installed to check the option of installing Prerequisites specified in the install settings of the plugin. This should in therory come up with a download and install dialog for the required .NET Framework ect. ?

    Has the win32 error something to do with incorrect signing? The plugin works fine on Windows 7 32bit.

    Thanks so far.

    Friday, January 25, 2013 8:49 AM
  • setup.exe is your installer app? how does it get created? via setup project in VS or something else? usually error like "not a valid win32 app" means that there is no .net framework installed and app is .net based so standard loader does not recognize file header.

    Normally it goes like this: in VS you create setup project , set prerequisites there (.net frameqwork, msi installer version, etc.), after building it, you will get setup.exe and setup.msi - first one is a bootstrapper which will check for prerequisites and second one installs your files and executes your custom actions, checks, etc.

    Friday, January 25, 2013 9:26 AM
  • It seems that MS discontinued supporting Setup Project Templates in VS 2012. My addin project was first created with VS 2010, as a Outlook 2010 addin. The person who did this is no longer around, and currently we only have VS 2012 available. When the addin was first created there was not much thought put in regarding different Office versions, but now 2007-13 have to be supported (this is the mess i have to clean up now).

    So the m.o. so far was to Project->Publish ADDIN, which generates a setup.exe, a .vsto and a folder with application files. As i understand now, this setup itself requires .NET 3.5?

    Assuming i have to stick to VS 2012, i guess i would have to fall back to a third party installer, make sure that this installer resolves any missing prerequisites for the generated setup.exe (like 3.5 or win-installer 3.1?) and then run the actual installer from within?

    Once again thanks for you patience. I am searching this stuff all day, with little success.

    Friday, January 25, 2013 10:58 AM
  • yes, either go back to vs2010 and create/maintain setup project or for vs2012 install installshield LE that also supports checking for prerequisties (or use any other technology that suits you)
    • Marked as answer by chilltax Friday, January 25, 2013 1:17 PM
    Friday, January 25, 2013 11:53 AM
  • all right, i think i will go with installshield for now. thanks for your help!
    Friday, January 25, 2013 1:17 PM