Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In the first part of this series, we went through the steps to create a simple Outlook 2010 add-in, how to build a custom ribbon, and finally the backstage area. But what use is your add-in unless other people can use it too? In part 2, we will look at the steps to create a setup package so that you can distribute your add-in to others.
Returning to the solution you started in part 1, you will now need to add a Setup Project. I’ll call mine “SetupMyOutlookAddIn”. When the project has loaded in, Visual Studio will bring up the File System screen of your Setup Project. We will need to make a few changes here:
We’ve now effectively told the setup project to install all our application goodness to the user’s AppData folder (Normally C:\Users\[username]\AppData in Windows 7, for example). We are doing this as this is a safe, sandboxed location that requires a minimum of privileges to install to. Here’s roughly how your screen should look now…
Now, we need to remove some of the .dll files that were added as Primary Output (because we do not need them). In Solution Explorer:
There are now 2 files you need to reference explicitly in your setup project. These are files that are created when you build your solution – so you will need to point to the release folder. You may use debug if you wish – just remember you are pointing there. For production software, you should point to release. So, in the File System window of your setup project:
Your File System window should now look something like this:
To get our add-in working, we will need to add registry keys. When you are developing the solution in Visual Studio, this happens automatically in the background, so it can be a surprise that you will need to do it explicitly! The keys we are creating will be saved to: HKCU\Software\Microsoft\Office\Outlook\Addins.
Open the Registry Panel in your Setup Project, then:
Here’s how your Registry screen should now look:
Now, we need to make sure that the Setup.exe you produce will check for prerequisites on the client system. This can be done by:
We’re pretty much done! A few things you may want to change:
Build your add-in, and then right-click your Setup Project and select Install. The next time you open Outlook, you should be prompted to allow your new add-in to run!
Written by Matthew Farmer
Anonymous
November 29, 2010
I have my database name and password in ConnectionString.xml file and i access like My.Application.Info.DirectoryPath from my code.I followed the given steps and i show error like "file not found". How can i add the xml file to my addins
mail id: dineshb.62@pearlsofttechnology.com
thank you in advance
dinesh
Anonymous
November 29, 2010
I have my database name and password in ConnectionString.xml file and i access like My.Application.Info.DirectoryPath from my code.I followed the given steps and i show error like "file not found". How can i add the xml file to my addins
mail id: dineshb.62@pearlsofttechnology.com
thank you in advance
dinesh
Anonymous
December 30, 2010
I fallowed the same steps bu while opening the outlook I got this error Please suggest me on the same.
Customization could not be loaded because the application domain could not be created.
************** Exception Text **************
Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created. ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'SolutionInstallerDialog'.
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstallerDialog.ShowDialog()
at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.Install(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeDeploymentManager, AddInInformation& info)
at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeAddInDeploymentManager, AddInInformation& info)
at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeAddInDeploymentManager, Boolean showUIDuringDeployment)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String documentFullLocation, String documentName, String assemblyLocation, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String documentFullLocation, String documentName, String assemblyLocation, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.ICreateCustomizationDomain.CreateCustomizationDomain(String documentFullLocation, String documentName, String assemblyLocation, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
Anonymous
January 09, 2011
Mukunda it looks like you are targeting VSTO 3. You may find more information about this problem here: social.msdn.microsoft.com/.../543a9f63-908e-4292-b30a-cff07e4b6709
Anonymous
January 09, 2011
Dinesh: Have you set the "Copy to Output directory" value of the xml file, and ensured that it appears in the file system/application folder of the Setup Project (you can put it there manually if not)? The other thing you could do is put the connection information in the project settings, so these will be shipped in the app.config automatically for you.
Matt
Anonymous
January 17, 2011
Hi,
thanks for this great step-by-step tutorial. I have followed it with interest, and written my first Outlook COM-AddIn.
My only problem is: after running the MSI file on another machine (not the dev machine), I have to double-click the .VSTO file in the installation directory to get the AddIn in Outlook.
Any ideas?
Best wishes
Michael
Anonymous
January 20, 2011
Michael, check registry settings. The "Manifest" value should be a path to your vsto file
Anonymous
April 12, 2011
i'm facing the same problem. tried out everything. running the setup won't make the add-in load in outlook. only running the vsto works! I have outlook 2010 64 bit on windows 7 64 bit and in my setup I've set the target platform as x64.
Anonymous
May 05, 2011
Hi
Thanks for a great guide. I'm facing some problems on my client computers after my add-in has been installed. I have even tried to use a "hello world" add-in but the same thing happens. The add-in is listed in Inactive Application Add-ins.
Do you have any suggestions on what could be wrong?
When I try to enable it I get the following error:
Anonymous
May 05, 2011
My issue is solved. The problem was that I used the "click-to-run" office trial on the test client machine. I downloaded the full install version and now everything runs smooth.
Anonymous
June 14, 2011
First, thanks for the tutorial it was extremely helpful. Second and this goes out to anyone who may know the answer. basically I have created an additional form region and added it to the appointment/meeting class. Everything works as expected however, if I send a meeting to users and then look in my personal sent items the additional form field is not there. It does appear if I pull up the appointment in the calendar though. I am thinking that it may be that the calendar appointment and the sent appointment are stemming from 2 different classes one being appointment and the other being mail but I was hoping to get some diffinitive insight into the matter. If it is because they stem from 2 different classes can the new form data be passed to the sent item object?
Any information anyone is willing to share would be greatly appreciated as I seem to be unable to find an answer via Google.
Thanks,
Dave
Anonymous
July 26, 2011
Hi All,
I've a few questions,
i want to make an add-in with this pourpouses.
i make a reply to a mail, when i push the send button, make me a question, if this mail is in a folder, and the answer is true, i reply this mail addin a new address to bcc and changing the subject.
But i do not know how i can make this.
Thanks
Anonymous
December 11, 2011
can i use outlook 2010 addin in outlook 2007
Anonymous
February 28, 2012
Hi,
am beginner , i do follow you tutorial ,
i have one problem , i want to show this tab in reading and explorer only
and hide in other actions(calender,task....)
how to do that...?
Anonymous
April 01, 2012
Top Article, works absolutly fine for me, Thanks!
Anonymous
April 25, 2012
I tried your example using Outlook 2010 Ultimate version on Outlook 2010 Professional but I don't see the add-in being loaded in outlook. Neither does it show in the Active Application Add-in or Inactive Application Add-ins. Can you tell me what could be wrong here.
Anonymous
August 13, 2012
Hi,
Excellent Articale !!!
However, I want my setup project to be installable on both outlook 2007 and 2010 as well. I followed the article for outlook 2010 and It works fine, but does not install well for outlook 2007.
Any Idea about how to make it work for both outlook 2007 and 2010.
Thanks
Anonymous
October 15, 2012
i am unable to find the .dll.manifest, and .vsto files from my application folder .i was clearly following your tutorial but now i got paused. please help me to finish it. what might have went wrong ???
Anonymous
December 05, 2012
Hi, its nice article. Can any body suggest to suppress the security message having options "Install" and "Don't Install". Moreover when I install setup its name is shown in install/uninstall list. When I run outlook first time, it install addin if i press "install" option and my addin project name becomes also visible in install/uninstall list. Is it normal behaviour. Futher when i uninstall the addin setup, setup name is removed from install/uninstall list but my addin project name remains there and i have to remove it manually by right click and uninstall option.
Anonymous
January 29, 2013
I wanted to call Connection string here.How can i do it ?
Anonymous
January 30, 2013
How do i add GridView to XML Document ? I tried to add another button like below but failed.
<primaryItem>
<button id="buttonBackStage" label="Sort" onAction="buttonBackStage_Click"/> <<< Working
<button id="buttonBackStage2" label="Sort2" onAction="buttonBackStage2_Click"/> <<< with this not working
</primaryItem>
Anonymous
March 07, 2013
Really good guide, much better than the official documentation. Just used this to publish my own Outlook plugin.
Thank you.
Anonymous
April 24, 2013
I am very new to VS 2010 and so how do I add a Setup Project. Do you mean, I create a completely new project. How to I get to File System screen of your Setup Project?
Anonymous
January 05, 2014
The comment has been removed
Anonymous
February 10, 2014
Thanks very much for this tutorial.
I was able to deploy an Outlook add-in successfully and have it automatically loaded by registry settings managed by GPO. So all good on that side of things!
However, I'm confused on how to deploy an update to the add-in.
I can see that running the initial install of the MSI deploys the manifest and vsto files to the application directory (C:Program Filesblah), then our registry changes force the vsto to be installed for the current user when they next start Outlook. All good.
If I then update the add-in and associated setup project, including all of the version numbers, the new MSI can successfully deploy the new manifest and vsto files to the same application directory but the user's add-in will not automatically update to use the new files, instead it will continue to run the old version of the add-in.
It appears that the vsto has to be first manually uninstalled by the user (they may see a duplicate of the add-in name in their Programs and Features control panel that they can uninstall even if they're not local admin).
After that the registry settings will again force the updated manifest and vsto files to be installed.
I just don't know why this bit isn't automatic when it sees the vsto and manifest files with higher version number in the application directory.
I can probably run the automatic uninstall through a logon script but just wondering if I am missing something?
Cheers
Anonymous
February 11, 2014
Dot Net 4.0 Client doesnt make addins can load. Must use dot Net 4.0 Full package.
Anonymous
April 13, 2014
excellent article! very complete and useful. Thank's
However some things are missing or problematic:
1 ◦ String - "Manifest" - set this to "[TARGETDIR] MyOutlookAddIn.vsto | vstolocal"
the corect value is: file :///[TARGETDIR]MyOutlookAddIn.vsto|vstolocal to avoid errors with vs2010
Anonymous
May 29, 2014
Thanks for this post ! Very helpful guide on building an AddIn. How can I release a change to the AddIn once it has been deployed already on a client ? Do I need to remove and install the setup again, or just copy some of the dll files?
Anonymous
September 09, 2014
I am new to Visual Studio. Can someone help me to create a setup project? How to create the setup project?
Anonymous
September 15, 2014
This will Help You "Partha " for creating a setup for your project ins visual studio
www.c-sharpcorner.com/.../adding-a-setup-project-in-visual-studio-2010.aspx
Anonymous
December 04, 2014
I have created outlook add in in visual studio 2010 with outllokk 2010. it is working fine but when i try to deploy my setup for office 2007 it is not working(means ThisAddin_NewMail) event is not raising also i have created new solution with office 2007 but i am not getting success...any suggestion
Anonymous
January 28, 2015
Hi, Great article , will this Add-in work in Outlook 2013 as well ?
Anonymous
January 29, 2015
Great Article. This has helped us. Thank a ton for this post.
Anonymous
March 25, 2015
Thanks for this great article. I have created this setup for my Outlook Addin. Have set the LoadBehavior property to 3. But after a few days, the registry entry of LoadBehavior automatically got changed to 2 and the add in started appearing in my "disabled add ins" section stating that the add in is taking more action to load than usual. Please tell me how can this be fixed?
Anonymous
May 12, 2015
Hi Ridhika, you can change that value opening the registry and going to the folder (HK_USERS-->Software --> Microsoft --> etc..) and changing the value of the LoadBehavior by yourself.
Another way would be making that the add-in loads, but that would be from Outlook's options.
Anonymous
March 15, 2016
Hi Ali
Yes this add in works with outlook 2013. I just tried
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in