MSMVPS.COM
The Ultimate Destination for Blogs by Current and Former Microsoft Most Valuable Professionals.

VSTO/ CAS Deployment Hell - How Good Intentions Go Bad

The Scenario

I'm supporting a VSTO application that does a pretty typical Office style thing. CAS policy updates to let the particular .NET assembly run are added to the end-users machine at install time, and the application works fine when the document is on the local machine.

The Nightmare

When the Office document is on a network share, a CAS error is raised. The solution is to add the server share to the OfficeDocumentMembershipCondition, and based on the code group membership condition, it can be granted full trust.

For some reason, the Office 2003 DLL (Msosec.dll) isn't installed in the GAC when Office is installed, so it is left to the poor VSTO developer to try to get the assembly into the GAC to do all the necessary CAS work. This MSDN document describes how to do it, and what a mess. You can tell your user "Umm, I hope your an admin. Let crack open the .NET Framework configuration tool and manually add an assembly to something called the GAC". That's a great experience. Alternatively, you can hope that the .NET Framework SDK is installed and batch out to GACUtil during your install (which will be running under the context of a local admin).

Obviously, this is a total mess. It creates a vulnerability (users need at least a temporary promotion to admin to add Msosec to the GAC), and it seriously error-prone. It is crazy installation experiences like this that really hinder the uptake of smart clients.
Posted Oct 13 2006, 08:02 AM by nick
Filed under:

Comments

.NET Performance wrote VSTO Deployment Problems - One Piece of the Problem Solved
on 11-04-2006 0:45

A couple of weeks ago I wrote about the frustrution of VSTO deployment , and the real hole that VSTO



Copyright © is the original authors. Blog site is an independent site not sponsored by Microsoft. The Yoda blog server and the Brianna SQL server would like to thank www.ownwebnow.com and www.exchangedefender.com. They wouldn't be here and broadcasting without the generosity of Vlad Mazek and his companies.

Powered by Community Server (Commercial Edition), by Telligent Systems