I developed an outlook plugin using C# and Visual studio Outlook addin template, that retrieves data from databases and generates a report off of the data.
Plugin works perfectly fine on my local machine. But when I distribute the plugin as an executable to the users, it does not work on the user's machine.
Meaning the addin is not checked by default and even if I check it manually, it does not show up on outlook in the addin bar.
I am unable to figure out if its due to the certificates or anything else.Do I need to install any certificates on the users machine ?
Could some one please help me out ?
EDIT
I right click on the solution file in solution explorer and publish to a folder to generate the setup.exe . My other team mate uses the same steps with the same project checked out of perforce and publishes a setup.exe. Now, his plugin works as expected on the user's machine and mine doesnot work (mine works only on my machine). So, I am not able to figure out what the difference is. Because we both are using the same framework (4.0) and VS (VS 2010 premium).It has something to do with the my machine. not sure if I am missing any installation
Did you have a chance to check out the Trust Center settings on the problematic PC? Are the VBA macro settings applied to COM add-ins? Is the Office application configured to load only signed add-ins?
Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.
Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.
Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.
When you re-enable a soft-disabled add-in, the application immediately attempts to load the add-in. If the problem that initially caused the application to soft disable the add-in has not been fixed, the application will soft disable the add-in again.
Read more about that in the How to: Re-enable an Add-in That Has Been Disabled article.
Also you may find the Troubleshooting COM Add-In load failures article helpful.
Hope the following steps will help you solve this problem. I assume you are using Outlook 2013 or 2010.
Run the deployed setup with administration rights.
If it is not shown under Add-ins, again open the setup folder and double click on the correct .vsto file then select install.
If you can see your add-in among others, and is not functioning, it means your add-in is disabled. To enable it go to File -> Slow and Disabled Add-ins, and you should see your add-in on the pop-upped window. Enable it.
Edit:
If your plug-in is shown in Disabled Add-ins try applying the following steps:
Enable your plug-in by File -> Slow and Disabled Add-ins, and you should see your add-in on the pop-upped window. Enable it.
Right click on your add-in bar and select Customize the Ribbon.
Then on the pop-upped window, choose All Commands from the left hand side combo box. You should be able to find your command in the list box.
When you find your command click on the Add button between the lists. This will add your command to the chosen category on the right hand-side list. Then click OK.
Your command should appear under the chosen tab.
How are you deploying the add-in? You need to be sure you have configured the installations settings so when you execute the installer MS Outlook knows were to find it and all of its installations components.
In my example I am using MS Project, Visual Studio 2012 with Install Shield.
Below is an example of the registry settings I use for my add-in. You will notice I have configured the manifest to point to installation directory and points to vstolocal.
You will also need to add your .vsto file to your build when constructing the installer.
Related
I have c# outlook addin created in visual studio 2013.
It has windows forms also.
I am getting mad on generating msi file, any easier solution/steps for me, please ?
Mainly tell me, after completing the process, where do I find the final MSI file (like bin/release folder) ?
I installed this - https://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054d
as well as installshield limited edition installer.
I was able to build it and ran the installation file(.exe) from disks folder and it is installing but not showing anything in the outlook.
Take a look at the Deploying an Office Solution section in MSDN. It describes two possible options for deploying your Office solution in depth:
Deploying an Office Solution by Using Windows Installer
Deploying an Office Solution by Using ClickOnce
It is up to you which way is to choose.
I was able to build it and ran the installation file(.exe) from disks folder and it is installing but not showing anything in the outlook.
There are multiple reasons why you don't see your add-in in Office applications.
First of all, make sure that you did all the steps described in the previously mentioned articles. Then I'd suggest checking the required windows registry keys for COM add-ins, see Registry Entries for Application-Level Add-Ins for more information.
Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.
Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.
Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.
You can read more about that in the How to: Re-enable an Add-in That Has Been Disabled article in MSDN.
Finally, you may also check out the Trust Center settings in Outlook. The Macro Security settings can be applied to add-ins as well. May be it is required to sign the add-in with a digial signature and etc.
I have developed an outlook AddIn, I tested it and it showed up the first time and then disappeared (I assumed it was because I set LoadBehavior to 16, so I changed it to 3). Check this link for more information about LoadBehavior
Then it worked fine for me and some other people. But for some other people the Addin didn't even show up in Outlook after that, just as if it is not installed.
1-The registries are correct.
2-The loadBehavior is 3, it does not change to 2.
3-The outlook AddIn is not listed in the Active, inactive or disabled addins.
4-There is no record for it in the registry's Disabled Addins entry.
5-The only way it works is by launching the .VSTO file. The .msi installation does not enable it.
On the machine where it actually worked:
The outlook version is 2013
OS is Windows 7 x64,
.Net Framework 4.
Thi is the same configuration for the all the machines.
I also looked at Fusion Log Viewer, nothing there was related to my Addin. It's like the AddIn is not detected or not considered as an AddIn.
Any ideas why is it behaving in such a way and/or how to fix it ?
Did you have a chance to check out the COM add-ins list in Outlook. Is your add-in listed there?
If so, there can be several reasons:
Your add-in can be disabled by the host application (Outlook in your case). Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.
Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.
Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.
When you re-enable a soft-disabled add-in, the application immediately attempts to load the add-in. If the problem that initially caused the application to soft disable the add-in has not been fixed, the application will soft disable the add-in again. Read more about that in the How to: Re-enable an Add-in That Has Been Disabled article in MSDN.
If you see your add-in in the active add-ins list - an error in the Ribbon UI. See How to: Show Add-in User Interface Errors for more information.
Finally, if you don't see the add-in listed in the COM add-ins listed you didn't register it properly in the windows registry. See the Deploying an Office Solution by Using Windows Installer article in MSDN which described all the required steps for deploying Office add-ins.
Are you sure that that your MSI file and your DLL targets Outlook's correct bitness?
You said that it worked on an x64 installation, are you sure it's compiled for both?
Haven't used much of the VSTO stuff but I think you may need to have your code shimmed.
I have made an Excel Add in (Ribbon).
When i run the .vsto and install it, i've one installation under Programs in Windows.
But, when I open my Excel program, another installation appears in the Programs-list.
Why is that and it shouldn't be like that right?
Update:
I notice in Application I have set Target framework: ".NET Framework 4 Client Profile"
and in Publish - Prerequisites it adds a Microsoft .NET Framework 4 Client Profile(x86 and x64), has that anything to do with it?
This can happen when you install the VSTO on your development computer. This is because when debugging the VSTO it will get installed though it won't show in the Programs & Features list. The VSTO will remain installed even after debugging is stopped. Even when performing a proper installation, remnants of the debugged VSTO will remain in the registry.
I've found the best way to work around this (though not ideal) is to manually remove the registry key at this location before performing a proper installation:
HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\[YOUR VSTO PROJECT NAME]
Because maybe in configuration you have set the application to update itself automatically.
So after Excel startup, it tryes to auto-update.
Is it possible?
It is very common to find two instances of the same add-in on your Excel application in a development machine. Since you must be building that add-in code inside your IDE before publishing or making a setup project build.
Whenever Excel starts it automatically detects the add-in manifests that are present on your computer.
Since you also installed your add-in your machine now has two locations where it finds your add-in one in your project folder and another at the location where you have installed the add-in.
So excel will, on its own add two add-ins because it found two add-ins, as simple as that.
And it has nothing to do with your Publish pre-requisites and Target framework.
You can simply go to FIlE->Options->Add-Ins-> over here in the window you'll find a Drop down with the label saying "Manage", in that select COM Add-ins and click on 'GO'.
Now in the window that opens, you'll find both your plug-ins listed there, you can remove the plugin that you do not want to see on your Excel app.
But, anyways the next time you build your excel add-in and start Excel it will again add that add-in automatically to your Excel app.
So it would be better not to install the add-in which you make on your machine until you want to test the installer or something like that.
The Outlook add-ins I have created using Visual Studio 2005 don't use the ClickOnce installer, just the regular Windows Installer.
(File -> New Project -> Extensibility -> Shared Add-In)
I need to create the add-ins using the ClickOnce installer because as far as I know that's the only way there is to sign the add-ins so they can run in spite of Macro Security settings on the clients' computers.
Can someone tell me how to create an Outlook add-in installer using ClickOnce?
Add an installer project to your solution. That will install the application to your program files directory which is trusted by default. It will require the end user to have admin privileged to install, but it does not require the installer files to be signed. It is not technically a click-once install, but it works very well for office add-ins.
Edit: You also need to add a reference to the addin to the registry. Check out Deploying a Visual Studio 2010 Tools for Office Solution Using
Windows Installer on MSDN. Figure 6 and the instructions preceding it describe how this is done.
The actual values to add to the registry key can be a bit confusing, so here are the ones that I used which work fine:
Description: "Provides functionality to access data from ..."
FriendlyName: "CompanyTools"
LoadBehavior: 3 (indicates that the add-in should be loaded at startup of the host application)
Manifest: "file:///[ProgramFilesFolder][Manufacturer]/[ProductName]/T360.Office.CompanyTools.vsto|vstolocal"
Also, I think that you need to add Microsoft.VisualStudio.Tools.Applications.Runtime.dll as a dependency. I don't think that it is by default.
Go to the project properties/Signing tab. Check "Sign the ClickOnce manifests" and provide your signing certificate.
Now go to the Publish tab. You need to fill in the publishing file location, which should be a URL or a file share. If the installation location is the same as the publish location, you can leave it blank.
Click the Prerequisites button and make sure the necessary prerequisites are selected.
Click the Updates button and pick how frequently to check or updates.
Click Options. Fill in the publisher name (typically your company), product name (how you want it to look in the uninstall page, and in the Add-Ins list in the Office product), and a support URL if you want. Check the Office Settings, too.
Fill in a publish version.
Click Publish Now. It will publish your deployment to the publishing file location.
You should be able to use the installation URL or publishing location to install the add-in. Note that if you have the Office product running, you need to close it and re-open it to load the add-in.
I'm trying to deploy Outlook add-in with ClickOnce.
While setting the update options I noticed that there are fewer options available for Outlook add in project than there are for Win Forms project. For example I cannot specify minimum required version. Why is that? Also, I would like:
to enable manual update
to ask user if he even wants an update (if it is not required).
1) I tried using System.Deployment.Application and CheckForDetailedUpdate() function but even though update succeeds there are problems installing it: If i restart my plugin it disappears from Outlook, if I don't the old version gets stuck in Outlook (and behaves oddly) although further updates via UNC path suggest that update has been successfully done.
2) Regular publish with no special options added with Mage or MageUI works in itself, but add-in seems to update without asking a user. Googling a bit reveils that people are trying to do the opposite, so I'm kind of puzzled as to why doesn't it prompt for update by default.
I tried editing manifests generated from Visual Studio with MageUI but it generates invalid XML for application manifest (?! - it misses "assemblyIdentity" node in "dependentAssembly" node), and when i add missing nodes from original manifest generated by VS (and update and sign it afterwards), installation complains about assembly hashes being invalid.
How can I deploy Outlook add-in with said requirements?
VSTO applications (Office Add-Ins) only support certain bits of ClickOnce. You can try adding code and doing programmatic updates, but the ClickOnce lead at Microsoft said it is not really intended to be used, and parts of it might not work. (No, no details on exactly which parts -- you have to do a bit of trial & error).
Also note that the way a vsto deployment works and runs is this: Outlook checks out the vsto app, and copies the dll(s) to a shadow location and loads that with Outlook. When you update the vsto app, it updates it in the click once cache, but not in outlook. When you close outlook and re-open it, it finds the new version, copies it out to the shadow location, and loads it. You can't restart the vsto bit itself and have it do anything. The user must restart Outlook.
This is one of the reasons that updates are performed when starting up the Office application. It looks for the new version, updates if necessary, and then loads it into Outlook and uses it.
Having said that, another way to accomplish what you want is to write a windows forms app that will update your add-in. Basically deploy a winforms app that just shows nothing the first time except invoke the vsto application via clickonce (process.start is your friend). Then you could have the outlook add-in invoke the winforms app the see if there's an update, and if there is, it could prompt for an update of the win forms app, and then uninstall and reinstall the office add-in or update it.