Unable to get outlook com addin to install correctly

  • Thread starter Thread starter michael.porfirio
  • Start date Start date
M

michael.porfirio

Hi,

I'm a very new to Visual Basic .Net and are having some issues with a
com add-in that I built. I'm using Visual Studio 2005 and have built a
simple com add-in that creates a command bar with a button. When this
button is clicked it launches a custom appointment form. When I build
the project from within Visual Studio, it builds with no errors and
when outlook is restarted the command bar appears and works exactly the
way I want it. Now, if I create an msi / setup.exe from within Visual
Studio from the project and then use it to install the button on the
same computer, the com add-in no longer appears. If you look under com
add-ins in outlook it's there, but it's unticked. If you try to tick
the box you get the following error: "Not loaded. A runtime error
occurred during the loading of the COM Add-in." I have also look
under Help/About/Disabled Items and there are no disabled items listed.
When you run setup.exe it puts all the files under
c:\ProgramFiles\request. I've checked the registry differences between
when I simply build the project and when I run setup.exe. The entries
look the same except for the manifest location when I run setup because
it now points to the new location. Can anyone help me? I need to get
this button deployed across my company asap and I've gotten to the end
of my limited knowledge of com add-in programming.
 
Did you set up security for your addin on the client machine as part of your
deployment?
 
It sounds like the issue is .NET Code Access Security. I'm guessing that you
built using Visual Studio Tools for Office (VSTO), which automatically
grants access to your assembly when you build it (using the full path), so
it runs/debugs with no problem from the build location. But your install
puts the assembly in a different location and the previously granted trust
no longer applies. If this is the case then you need to modify your setup
project to grant full trust to the installed assembly.

This article http://msdn2.microsoft.com/en-us/library/s66ay8f7(VS.80).aspx
discusses one method of doing that. Look for "Code Access Security Policy"

Sue Mosher page on VSTO (http://www.outlookcode.com/vsto/index.htm) has a
list of articles on deployment. The two by Mads Nissen cover a different way
to have the MSI run an action that grants trust to your assembly.
 
Back
Top