VSTO in Visual Studio 2010

V

One of the biggest hurdles with VSTO is deployment.

As you probably know, the pre-requisites for running a VSTO app (even of the simplest Hello World variety) include:

  • .NET Framework 3.5
  • Primary Interop Assemblies (PIAs)
  • VSTO Runtime
  • (Plus Office of course)

Now, packaging these isn’t the issue, since the Visual Studio team have worked hard to make the ClickOnce process a simple and seamless experience. The issue is the size of the download, plus requiring Admin privileges on the box you are installing on. For developers like you and me this doesn’t sound like much of a problem, but for an IT Manager in charge of rolling a simple VSTO app out across an enterprise this can be a significant headache (although Group policy can solve some of this).

And it doesn’t stop there, because if you have a number of VSTO add-ins going out, each of them needs to be installed separately. Finally there’s limitations with how to control post-install events (Eg copying Word or Excel templates into the proper locations).

The VSTO team have been focusing on deployment and security issues over the last 2 releases, and in the VS2008 release they made significant improvements. The recent SP1 for .NET 3.5 further eased the process.

But, it’s a process that still needs improvement.

Visual Studio 2010Visual Studio 2010

So, it’s good to see that the team are making excellent progress in VS2010. As the recent PDC presentation from Saurabh Bhatia demonstrated (PowerPoint file here), there’s already key functionality increases.

[UPDATE: Removed the embedded presentation as it was preloading and sucking bandwidth – click here to view]

The main points covered are:

  • Multi-project deployment (eg install an Outlook add-in, Excel add-in and Word add-in all at once)
  • Post deployment custom actions (eg moving files to user directories, deleting files during uninstall)
  • No-PIA installs (no need to include the PIAs – achieved via Type Embedding – a feature in CLR 4.0

This is welcome news to VSTO developers (actually probably more so for IT Managers). The pre-requisites are now down to the .NET Framework and the VSTO Runtime, and complex VSTO applications can be installed with a single install and enabled to configure itself.

It’d be so much simpler if the VSTO Runtime was automatically installed with Office or the Framework, but as we know, Microsoft are trying to reduce install sizes these days not add to them. Deployment will always have its pain points – good to see the team are getting close to an acceptable compromise.

11 comments

  • I wish vs 2008 sp1 would fix the html corruption on large projects bug!! Maybe when visual studio 2008 sp2 comes out then we can finally use vs 2008. I hope to God vs 2010 has that fixed!! Com on Microsoft!!

    KeepMyMarbles.com

  • I wish vs 2008 sp1 would fix the html corruption on large projects bug!! Maybe when visual studio 2008 sp2 comes out then we can finally use vs 2008. I hope to God vs 2010 has that fixed!! Com on Microsoft!!

    KeepMyMarbles.com

  • would be great if vsto allowed the streaming of xml content into office docs eg ActiveDocument.InsertXML(Range, stream).

  • would be great if vsto allowed the streaming of xml content into office docs eg ActiveDocument.InsertXML(Range, stream).

  • I have previously built a solution using Excel Automation in ASP.Net 3.5 which actually reads data from the excel file and its different sheets and dumps it in a database (SQL Server). I have two questions:
    1) Can i achieve the same using VSTO?
    2) The solution has to be hosted on a shared web server of the hosting provider where they donot allow excel installation, will this solution work in that environment?

    • Most of your ASP.NET code will work in a VSTO project (ie the code for reading the data, walking through different worksheets, etc).
      But since a VSTO add-in is built around the Excel object model you’ll need Excel install in order to use it.
      VSTO add-ins are for client app, they’re not designed for server hosting.

  • I have previously built a solution using Excel Automation in ASP.Net 3.5 which actually reads data from the excel file and its different sheets and dumps it in a database (SQL Server). I have two questions:
    1) Can i achieve the same using VSTO?
    2) The solution has to be hosted on a shared web server of the hosting provider where they donot allow excel installation, will this solution work in that environment?

    • Most of your ASP.NET code will work in a VSTO project (ie the code for reading the data, walking through different worksheets, etc).
      But since a VSTO add-in is built around the Excel object model you’ll need Excel install in order to use it.
      VSTO add-ins are for client app, they’re not designed for server hosting.

  • Hello Craig,

    I have developed a VSTO excel addin and now the challenge is to deploy at client machines.

    Could you please suggest an appropriate way to create a click once deployment package,
    so the i can bundle the VSTO files along with related dlls into the deployment package.

    And upon Uninstalltion remove the installed files as well.

    Awaiting to hear from you.

    Please post your suggestions to my email id : sreejith.rajan@yahoo.co.in

    Regards,
    Sreejith

By Craig Bailey

Archives