Outlook add-in installed but will not load

M

Mike

I have an Outlook add-in developed in VS2K5 using VSTO. .NET 2.0 is
installed on the target machine, I've deployed the PIA's, and the vstor.exe
to install the runtime, and all that went fine. However, the add-in won't
load, and when I try to do it manually (Tools/Options/Other/Advanced
Options/COM Add-Ins), the load behavior shows an error message of: "Not
loaded. A runtime error occurred during the loading of the COM Add-in.". I
see nothing in the Event log, no kind of Install log in the Program Files
folder, nothing that I can tell that can help me troubleshoot what is going
on. Can someone offer me some suggestions? Very much appreciated!
 
M

Mike

Ken, thank you as always for your quick response. I'm confused about CAS and
how to actually set it, but I used a VS2K5 setup project and according to the
article I shouldn't need to do this?

"When you use VSTO 2005 to build your solution, Visual Studio grants
appropriate trust to the customization assembly and to any other referenced
assemblies using the build location as the evidence. However, if you copy the
solution to another location on the hard disk or publish the solution, you
must explicitly grant security permissions to the copied or published
assemblies."
 
K

Ken Slovak - [MVP - Outlook]

That applies to when you run in debug mode or run on your dev machine. If
you deploy the project you must use strong naming and then set the security
on the target system. Otherwise the code won't load and run.

The signing approach (strong naming) requires a code certificate, setting
strong naming, building, signing the build (setting strong naming identifies
the certificate to sign with but doesn't actually sign the code), using
SetSecurity, then signing the resulting deployment (optional).
 
M

Mike

Now I am thoroughly confused. The SetSecurity project that the 2nd article
speaks of is nowhere to be found, but it is also specific to VSTO SE, and I'm
only using VSTO for my add-in. However, I downloaded the SE version, ran the
install, but still no SetSecurity project to be found.

I've seen yourself and others state that VSTO deployment can be a sore spot,
and now I can see why. I don't mind doing the work, I just don't understand
CAS all too well. Thanks for anything you can provide.
 
K

Ken Slovak - [MVP - Outlook]

For a more specific to VSTO 2005 as opposed to VSTO 2005 SE walkthrough look
at http://msdn2.microsoft.com/en-us/library/aa537173(office.11).aspx. But
also look at the other walkthrough, it's very comprehensive.

Both walkthroughs have downloads that provide the SetSecurity project. They
are pretty easy to follow, the only tricky part is to put all of each custom
action on one line with the switches separated by spaces. The newlines added
by formatting in the walkthroughs are deceptive.
 
M

Mike

I am having absolutely no luck. I've installed the samples and included the
SetSecurity project in my add-in project, followed the steps in the
walkthrough, but still the same problem. Is there any way at all to see what
is happening or what error is being thrown? I don't see any type of log, or
any events in the Event log, or anything like that. Just the vague message
 
K

Ken Slovak - [MVP - Outlook]

All I can say is that when I've followed the steps in the walkthroughs
extremely carefully I've been able to get things going. In addition to the
security stuff are you deploying extensibility.dll and stdole.dll to your
installation folder? I've found that to be necessary in most cases with
Outlook 2003 and earlier.

My best suggestion for something like this which is strictly VSTO deployment
specific is to post in the VSTO forum on MSDN, the VSTO team members hang
out there and would be far better than I am with various deployment issues.
The forum is at
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=16&SiteID=1.

See if they can help you there.
 
M

Mike

Making some progress...I started removing various components, got the thing
to install and run correctly, then started adding components back in to see
when it would break. I now have a question regarding the CAS for other
assemblies. the SetSecurity project seems to set the CAS for the main
assembly, but what about others? I have isolated the line of code which I
think throws an exception, but I cannot get any kind of response when running
on the deployed machine. I have code in a button which attempts to
instantiate an object from a seperate assembly, but absolutely nothing
happens. when i comment that line of code, I'll see my message boxes both
before and after that line, but it seems like just having that code in there
throws some kind of exception, but it doesn't seem to be trappable. for
example, here's how I've tried it (example below is generic names and pseudo
code):

private void Sub...etc.
{
MessageBox.Show("start");
try
MessageBox.Show("1");
ObjectA oa = new ObjectA.TypeA
MessageBox.Show("2");
catch
MessageBox.Show(ex.Message);
}

when the ObjectA (from external assembly) line is commented, I see all
Message boxes. when uncommented, I see nothing, but would expect to see the
"start", "1", and exception message boxes.

Do I need to somehow include this assembly in the SetSecurity project?

Thanks again.
 
K

Ken Slovak - [MVP - Outlook]

I would say that you would need to do the same for the satellite assembly
and create a set of custom actions for that also.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top