Modify VSTO addin's manifest to work it as Invoker

D

Dhananjay

Hi All,
I have developed one COM- addin in VSTO / VB 2005 / Office 2007. As we
know that, if we create a VSTO addin, then it is having manifest file
as well. As I have been told that, I should add UAC manifest to my
application, please can anybody tell me how to modify VSTO addin's
manifest file, so that I can use my addin as a "Invoker".

Thanks,
Dhananjay
 
D

Dhananjay

Thanks Ken, for your valuable reply.
I downloaded SDK & used orca to change the msi to "UAC Compliant".
Now it is not showing me the UAC dialog for "An unidentified program
wants to access your computer". Thanks for it.
But I want to modify my VSTO addin's manifest, so that I can run my
addin as a Invoker.
Basically, my addin writes the trace in the application directory.
This is my snippet for writing trace.txt file

Try
Dim fs As System.IO.StreamWriter
fs = IO.File.AppendText(AppPath & "\Trace.txt")
fs.WriteLine(Now & ": " & st)
fs.Close()
fs = Nothing
Catch ex as Exception
......

Everytime there is an exception while writing to trace.txt file.
Someone told me that If my addin runs as a Invoker, then there will be
no problem.
Also I can not force to the client to install my addin in
AppDataFolder, so client installs the addin in "Program Files", where
my trace file is not generated.
I have set permission for my addin as "FullTrust" as required. I used
"SetSecurity" project for that.
Meanwhile, your project works fine on my machine after I changed your
FolderPP class to inherit from "System.Windows.Forms.UserControl" in
place of "System.Windows.Forms.Form".

Thanks again,
 
K

Ken Slovak - [MVP - Outlook]

In almost all cases on Vista a program has no permissions to write to the
Program Files hierarchy. It's also considered to be not a best practice to
do that even where the OS doesn't prevent writing there. The best practice
is considered to be writing things such as error logs to LocalAppData.

I'm not sure what you mean about changing the FolderPP class to inherit from
UserControl, that's what it does now. The first code line in FolderPP.CS
(and the equivalent in VB.NET) is:

public partial class FolderPP : UserControl
{

Which to me indicates that it inherits from
System.Windows.Forms.UserControl.

Can you explain what you're seeing and what you're doing?
 
D

Dhananjay

Hi Ken!
I downloaded your project from the site you mentioned viz.
http://www.slovaktech.com/outlook_2007_templates.htm & the project zip
name is VSTO_VBNETAddin.zip.
After that when I opened your project, in FolderPP.Designer.Vb file I
can see very first 3 lines are -

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FolderPP
Inherits System.Windows.Forms.Form

That means you are inheriting from System.Windows.Forms.Form & not
from UserControl.
I just changed that line to inherit from UserControl.
Any way, Thanks a billion for your valuable reply, which solves my
problem of property page.

Thanks again,
Dhananjay
 
K

Ken Slovak - [MVP - Outlook]

Hmm, the copy of the project I have here (and that I wrote) inherits from
System.Windows.Forms.UserControl, not from Forms.Form.

It looks like VS did something when I exported the project as a project
template and changed my original inheritance from UserControl to Form.
 
K

Ken Slovak - [MVP - Outlook]

I posted a fixed version of that template on my Web site. It looks like
somehow VS changed the inheritance in both the ToolsOptionsPP and FolderPP
designer classes from UserControl to Form inheritance. That wasn't done in
the C# projects or the shared addin project for VB.NET.

Anyway, the projects on my Web site are now correct.
 

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