Wednesday, March 21, 2007

VSTO 2005 SE Publish Wizard

Warning : If you use the VSTS 2005 SE Publish Wizard it creates a set of files that cannot be moved from the published folder.

An easier way of deploying your Excel application to a small number of clients is to compile and then copy the *.xls and *.dll file from your application bin\release folder to a location on your network or client pc.

You then need to setup a .NET 2.0 trust for the folder containing your files. I prefer to use the graphical UI tool to do this. In order to get the "Microsoft .NET Framework 2.0 Configuration" tool in Control Panel->Admin Tools you need to install the .NET 2.0 SDK. Get it here 340Mb just to get one tool...ouch! When you install this you only need the tools, don't install the samples or documentation.

Once you have installed the SDK you can open "Microsoft .NET Framework 2.0 Configuration" from Control Panel->Admin tools to setup a trust for the folder holding your files. Open "Microsoft .NET Framework 2.0 Configuration" and expand my Computer -> Runtime Security Policy -> Machine -> Code Groups -> All_Code -> My_Computer_Zone, right click on My_Computer_Zone and select "New...". Name the item and press Next, change the Membership condition to URL and enter the path to your folder in this format:-


The "file://" is required as a prefix. "\*" is required at the end so the entire folder is trusted. Then on the Permission Set tab change to FullTrust. This sets up trust to allow anything in the c:\FolderName folder to execute. You may want to setup a more restrictive permission set. You may also want to uninstall the SDK once you have setup the trust. You can also use a command line tool to setup these trusts but I could not work out how to use it as you cannot see what it has changed.

If you are installing the files on a network folder you need to use LocalIntranet_Zone rather than My_Computer_Zone.

In order to change these settings you need local admin rights on the client pc.

Before you can install a VSTO SE App you need the following :-

Office 2003 Professional
SP2 is not required but well worth installing anyway

Microsoft .NET Framework 2.0

Microsoft .NET Framework 2.0 SDK

Office 2003 Primary Interop Assemblies

VSTO 2005 SE runtime

Install in the order shown above.

No comments: